I wrote a Dancer app, with the log config:
logger: file
logger_format: <%T> %m
log_path: '/usr/local/myapp/log'
log_file: 'myapp.log'
log: debug
and start it with:
plackup -E deployment -D -s Starman --workers=10 --port 8080 -a bin/app.pl
rotate the log file with logrotate
/usr/local/myapp/log/myapp.log {
daily
rotate 10
create 0660 root root
compress
missingok
dateext
}
but the new logfile is zero.
I tried to add postrotate in logrotate conf to send HUP and process HUP sinal in bin/app.pl
with
Dancer::Logger::File::init;
but nothing help.
Can anyone tell me how to rotate the dancer's logfile?