Logging with Cronolog?
Issue #227
resolved
I suspect this issue is due to my lack of knowledge. Hopefully someone here can set me straight.
I'd like to use cronolog to rotate monit's log files monthly. I figured this configuration would work:
set logfile "|/usr/sbin/cronolog /var/log/monit/%m-monit.log"
But that gives me a syntax error. I've tried some variations on that, but no luck. Is there a way to do this with Monit?
Thanks
Comments (3)
-
repo owner -
reporter Thanks for the help. Much appreciated.
-
reporter - changed status to resolved
resolved
- Log in to comment
The "set logfile" statement option is either absolute path to the log file or "syslog" token, to log via syslog. Pipe is not supported.
If you want to logrotate, i recommend to send logs to syslog (and then use system's logrotate):
or path to file with system logrotate (note that you'll need to call "monit reload" after you rotate the log externally, so monit will close the logfile and open new one):