Docker containers are often run on ephemeral infrastructure with no persistent storage for logs. You can send and aggregate container stdout, Python logs, and file based logs to LogEntries in realtime.
- Create a new log set named {PROJECT_NAME}.{DOTENV}.
- Create manual (token TCP) logs named docker-logentries, docker-logspout and python in that log set.
- Replace {DOCKER_LOGENTRIES_TOKEN} and {DOCKER_LOGSPOUT_TOKEN} in your compose or stack file, and {PYTHON_TOKEN} in your dotenv file, with the tokens created above.
- Copy your account key to LOGENTRIES_ACCOUNT_KEY in your dotenv file. See: https://docs.logentries.com/v1.0/docs/accountkey/
- Add logentries.py to BASE_SETTINGS in your .env.base file.