Logging with Cronolog?

Issue #227 resolved
Ian Whitney created an issue

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?


Comments (3)

  1. Tildeslash repo owner

    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):

    set logfile syslog

    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):

    set logfile "/var/log/monit.log"
  2. Log in to comment