Rotate logs (#347)

* Reopen file/program outputs on SIGUSR1

When signaled with SIGUSR1, close and reopen file and program based
outputs. This is useful when combined with logrotate to rotate logs.

* Example logrotate config

Example logrotate config that relies on SIGUSR1 to rotate logs.

* Ensure options exist for all outputs

Options may not be provided for some outputs (like stdout), so create an
empty set of options in that case.
This commit is contained in:
Mark Stemm
2018-04-05 14:31:36 -07:00
committed by GitHub
parent a5daf8b058
commit 8389e44d7b
6 changed files with 117 additions and 23 deletions

7
examples/logrotate/falco Normal file
View File

@@ -0,0 +1,7 @@
/var/log/falco-events.log {
rotate 5
size 1M
postrotate
/usr/bin/killall -USR1 falco
endscript
}