meta data for this page
  •  

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
linux:docker:log [2024/08/01 08:39] niziaklinux:docker:log [2025/03/17 21:03] (current) niziak
Line 3: Line 3:
 Prevent disc space flooding with container logs: Prevent disc space flooding with container logs:
  
 +  * [[https://signoz.io/blog/docker-log-rotation/|Docker Log Rotation Configuration Guide | SigNoz]]
   * [[https://willsena.dev/strategies-for-rotating-docker-logs/|Strategies for Rotating Docker Logs]]   * [[https://willsena.dev/strategies-for-rotating-docker-logs/|Strategies for Rotating Docker Logs]]
   * [[https://www.paulsblog.dev/how-to-manage-docker-logfiles-with-logrotate/|How To Manage Docker Logfiles with Logrotate]]   * [[https://www.paulsblog.dev/how-to-manage-docker-logfiles-with-logrotate/|How To Manage Docker Logfiles with Logrotate]]
   * [[https://alexanderzeitler.com/articles/rotating-nginx-logs-with-docker-compose/|Rotating nginx logs using Docker Compose and logrotate]]   * [[https://alexanderzeitler.com/articles/rotating-nginx-logs-with-docker-compose/|Rotating nginx logs using Docker Compose and logrotate]]
 +
 +<file txt /etc/logrotate.d/docker-container>
 +/var/lib/docker/containers/*/*.log {
 +    rotate 4
 +    weekly
 +    compress
 +    size=100M
 +    missingok
 +    delaycompress
 +    copytruncate
 +}
 +</file>
 +
 +===== nginx logs =====
 +
 +<file txt /etc/logrotate.d/docker-nginx>
 +/srv/nginx/logs/*.log {
 +  weekly
 +  missingok
 +  rotate 4
 +  dateext
 +  compress
 +  delaycompress
 +  notifempty
 +  sharedscripts
 +  postrotate
 +    cd /root/dockers/nginx \
 +      && /usr/local/bin/docker-compose kill -s USR1 nginx
 +  endscript
 +}
 +
 +
 +</file>