Fix logrotation rules
* explicitly specify the dirs that are getting rotated * app log rules are now moved to logrotate.ejs * we keep task logs for a week Some testing notes: * touch -d "10 days ago" foo * logrotate /etc/logrotate.conf -v to test rotation. there is a state file created in /var/lib/logrotate/status. If we have a 'daily' rule, it will get processed only after a log line in status exists and it's atleast 1 day old timestamp. https://github.com/logrotate/logrotate/blob/master/logrotate.c is quite readable
This commit is contained in:
+20
-8
@@ -1,11 +1,23 @@
|
||||
# Generated by apptask for the /run mount
|
||||
# Generated by apptask
|
||||
|
||||
# keep upto 7 rotated logs. rotation triggered daily or ahead of time if size is > 1M
|
||||
<%= volumePath %>/*.log <%= volumePath %>/*/*.log <%= volumePath %>/*/*/*.log {
|
||||
rotate 7
|
||||
daily
|
||||
compress
|
||||
maxsize=1M
|
||||
missingok
|
||||
delaycompress
|
||||
copytruncate
|
||||
rotate 7
|
||||
daily
|
||||
compress
|
||||
maxsize 1M
|
||||
missingok
|
||||
delaycompress
|
||||
copytruncate
|
||||
}
|
||||
|
||||
/home/yellowtent/platformdata/logs/<%= appId %>/*.log {
|
||||
# only keep one rotated file, we currently do not send that over the api
|
||||
rotate 1
|
||||
size 10M
|
||||
missingok
|
||||
# we never compress so we can simply tail the files
|
||||
nocompress
|
||||
copytruncate
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user