-
Notifications
You must be signed in to change notification settings - Fork 2
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
Logrotate #73
Comments
We can use this as the base image https://github.com/samsung-cnct/logrotate |
@mbtamuli I'm mounting |
The log volumes are accesible directly in the directory # ls -al /var/lib/docker/volumes/examplecom_log_php/_data/
total 12
drwxr-xr-x 3 root root 4096 Dec 27 16:35 .
drwx------ 77 root root 4096 Jan 4 07:58 ..
drwxr-xr-x 2 www-data www-data 4096 Dec 27 16:35 _data
# ls -al /var/lib/docker/volumes/example1com_log_php/_data/
total 92
drwxr-xr-x 2 www-data www-data 4096 Dec 27 16:35 .
drwxr-xr-x 3 root root 4096 Dec 27 16:35 ..
-rw------- 1 www-data www-data 35375 Jan 3 17:46 access.log
-rw------- 1 www-data www-data 40619 Jan 3 17:45 error.log So in this case, we have to mount
|
|
Logrotate is added as global service with 1. docker-compose.yml content for logrotate service will be like following.
|
@mbtamuli |
@mbtamuli Check this out. Maybe helpful for us. |
Example log
Nginx-proxy
|
Why in the first config you have to reload services and in the second you simply use copytruncate? |
@fabiomontefuscolo The idea by then was to move the Nginx-proxy to reload only. But I decided to do it when implementing it in EE. The difference between reload and copytruncate is here Due to less overhead & faster speed, I am more leaning towards reload method only. |
docker inspect -f '{{ .State.Pid }}' $absolute_site_nginx | xargs kill -USR1
docker inspect -f '{{ .State.Pid }}' $absolute_site_php | xargs kill -USR1 with $(docker inspect -f '{{ .State.Pid }}' $absolute_site_nginx | xargs kill -USR1) || echo "ok"
$(docker inspect -f '{{ .State.Pid }}' $absolute_site_php | xargs kill -USR1) || echo "ok" Thank you, @dhsathiya |
We need to run logrotate periodically on the host to check and rotate log files.
The text was updated successfully, but these errors were encountered: