-
Notifications
You must be signed in to change notification settings - Fork 123
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
[Q] How to log rotate go-carbon log file in Docker container? #466
Comments
hi yeah, I think using logrotate would be a way to go. that's what we are using on prod. (also the lib zapwriter used in go-carbon detects log rotation and it will re-open log files after rotation). |
Hi, many thanks for the reply. |
we run go-carbon on bare metal servers with carbon as user. by your description, it sounds like generic docker setup issue. maybe @deniszh has some insight? |
We're using carbon in Docker image - https://github.com/go-graphite/go-carbon/blob/master/Dockerfile#L22 |
No problems. I'll make some other tests in order to have a clear view of what is happening. |
If you find generic solution - we would like to accept it. Running process as root in containers is not recommended and discouraged by security reasons IIRC, so, that's not generic solution, alas. Thanks for looking into this, much appreciated! |
Okay, I found two sources of problems:
|
stderr cannot be accessed with a non-root user in Docker containers as discussed here, so how can log rotation be applied to an arbitrary log file?
Should I relay on the host log rotation system by bind mounting the file?
Many Thanks,
Francesco
The text was updated successfully, but these errors were encountered: