Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Is it possible to log to docker logs? #27

Open
timwis opened this issue Mar 26, 2021 · 1 comment
Open

Is it possible to log to docker logs? #27

timwis opened this issue Mar 26, 2021 · 1 comment

Comments

@timwis
Copy link

timwis commented Mar 26, 2021

Hello, I'm running this container in production, but it's a bit tricky to view its logs to troubleshoot an issue.

I use a platform-as-a-service (Digital Ocean App Platform, which is similar to Heroku), which streams the results of docker logs to a web interface. Unfortunately this doesn't show anything with this container, like it does for the official nginx image. Similarly, if I were to SSH into my server and run docker logs I wouldn't see the logs. I'd have to attach to the container and tail the access.log and error.log.

The official nginx image creates a symbolic link from /var/log/nginx/access.log to /dev/stdout, and creates another symbolic link from /var/log/nginx/error.log to /dev/stderr, which allows docker to output its logs without nginx knowing. This amplify image undoes this, assumedly so the python agent can access the log files asynchronously.

This sounds like an issue most users of this docker image have faced. Any suggestions for how to stream the logs to docker logs?

@sdurandeu
Copy link

The docs talk about using syslog, however it does not seem to be straightforward to configure this in a docker environment. If someone has more specific instructions on how to do this, much appreciated 😄

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants