forked from wrenn/wrenn
Add production file logging with logrotate support
Both control plane and host agent now write structured slog output to $WRENN_DIR/logs/ in addition to stderr. Log level is configurable via LOG_LEVEL env var (default: info). SIGHUP reopens the log file so logrotate can rotate without copytruncate.
This commit is contained in:
19
deploy/logrotate/wrenn
Normal file
19
deploy/logrotate/wrenn
Normal file
@ -0,0 +1,19 @@
|
||||
/var/lib/wrenn/logs/control-plane.log
|
||||
/var/lib/wrenn/logs/host-agent.log
|
||||
{
|
||||
daily
|
||||
rotate 3
|
||||
missingok
|
||||
notifempty
|
||||
dateext
|
||||
dateformat -%Y-%m-%d
|
||||
compress
|
||||
delaycompress
|
||||
sharedscripts
|
||||
postrotate
|
||||
# Signal the processes to reopen their log files.
|
||||
# Use SIGHUP — both binaries handle it gracefully.
|
||||
pkill -HUP -f wrenn-cp || true
|
||||
pkill -HUP -f wrenn-agent || true
|
||||
endscript
|
||||
}
|
||||
Reference in New Issue
Block a user