[Dovecot] log_path - expansion possible?
Does (or can) the ability to use expansion variables in Dovecot's log_path exist?
ie:
log_path = /var/log/dovecot/dovecot-%Y%m%d
-- Robert Blayzor INOC, LLC rblayzor@inoc.net http://www.inoc.net/~rblayzor/
On 5.12.2012, at 17.24, Robert Blayzor wrote:
Does (or can) the ability to use expansion variables in Dovecot's log_path exist?
ie:
log_path = /var/log/dovecot/dovecot-%Y%m%d
Not currently. It would be possible to make it work, but it would require that Dovecot gets SIGHUPed every midnight to get the configuration reloaded. But you could already do that with logrotate, which I think is a better solution anyway.
On Dec 5, 2012, at 10:33 AM, Timo Sirainen <tss@iki.fi> wrote:
Not currently. It would be possible to make it work, but it would require that Dovecot gets SIGHUPed every midnight to get the configuration reloaded. But you could already do that with logrotate, which I think is a better solution anyway.
Why SIGHUP? If it's an already open file handle you could just compare the string expansion against the currently opened log/FH, and if different open a new FH?
If not possible perhaps able to pipe logs to an external programs like apache's rotatelogs ?
-- Robert Blayzor INOC, LLC rblayzor@inoc.net http://www.inoc.net/~rblayzor/
On 5.12.2012, at 17.41, Robert Blayzor wrote:
On Dec 5, 2012, at 10:33 AM, Timo Sirainen <tss@iki.fi> wrote:
Not currently. It would be possible to make it work, but it would require that Dovecot gets SIGHUPed every midnight to get the configuration reloaded. But you could already do that with logrotate, which I think is a better solution anyway.
Why SIGHUP? If it's an already open file handle you could just compare the string expansion against the currently opened log/FH, and if different open a new FH?
Sure, and it could do that with the other 1000 settings as well. I think I've seen maybe once in last 10 years the same feature request. Not really worth the extra code.
If not possible perhaps able to pipe logs to an external programs like apache's rotatelogs ?
In theory, yeah, I guess .. I'd probably make it a new setting, like log_executable = /usr/bin/rotatelogs. But I don't really have time to implement this myself right not.
Robert Blayzor wrote:
Does (or can) the ability to use expansion variables in Dovecot's log_path exist? log_path = /var/log/dovecot/dovecot-%Y%m%d
Dovecot is able to send logs to a (configurable) syslog_facility. Rsyslog logging daemon is able to write different files depending on time. There are available properties like $YEAR $MONTH $DAY $HOUR $MINUTE in rsyslog.
Regards Daniel
On Dec 5, 2012, at 5:35 PM, Daniel Parthey <daniel.parthey@informatik.tu-chemnitz.de> wrote:
Dovecot is able to send logs to a (configurable) syslog_facility. Rsyslog logging daemon is able to write different files depending on time. There are available properties like $YEAR $MONTH $DAY $HOUR $MINUTE in rsyslog.
I'm aware of the syslog functionality; the same can be done with syslog-ng. But I was hoping for a something a little more flexible for local filesystem based logs. (or over NFS). As a workaround I just put something like this in cron:
mv dovecot.log date -v-1d +"dovecot-%Y%m%d"
&& kill -USR1 cat /var/run/dovecot/master.pid
-- Robert Blayzor INOC, LLC rblayzor@inoc.net http://www.inoc.net/~rblayzor/
participants (3)
-
Daniel Parthey
-
Robert Blayzor
-
Timo Sirainen