forked from DStorck/logrotate
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathlogrotate.conf
executable file
·25 lines (20 loc) · 1.07 KB
/
logrotate.conf
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
# we were hoping to have path be /var/log/containers/*/* but logrotate was having issues with the wildcard
# the path made by shared-logging-directory will force the underscore and a number so it will pass the glob pattern
# for now this configuration does not handle deleting directories from pods that have died off. There is a sample for what may work
# (clean-completed-pods.sh) that can be called by inserting the following into this configuration under 'rotate':
# firstaction
# /clean-completed-pods.sh
# endscript
# the clean-completed-pods.sh file will also needed to be COPIED in the dockerfile to /
# in the future a more robust solution may have to be created, perhaps by writing a custom binary to query the api server
# to see if that app still exists and try to match the IP address returned to the IP in the directory name, since the
# directory name created for logs will by default contain the pod name, pod namespace and pod ip
/var/log/containers/*_[0-9]*/*
/var/log/containers/*_[0-9]*/*/* {
maxsize 10M
daily
nomail
create
missingok
rotate 0
}