[Dovecot] rotate logs ?
Hello
is there an internal mechanism in dovecot to rotate logs daily ?
thanks
-----Original Message----- From: dovecot-bounces+nick.lunt=patech-solutions.com@dovecot.org [mailto:dovecot-bounces+nick.lunt=patech-solutions.com@dovecot.org] On Behalf Of Frank Bonnet Sent: 18 January 2011 09:41 To: Dovecot Mailing List Subject: [Dovecot] rotate logs ?
Hello
is there an internal mechanism in dovecot to rotate logs daily ?
thanks
How about putting the something similar to the following in /etc/logrotate.conf (on redhat/centos)
/var/log/dovecot.log { weekly minsize 1M create 0664 root postfix rotate 4 }
Cheers Nick .
__________ Information from ESET NOD32 Antivirus, version of virus signature database 5795 (20110117) __________
The message was checked by ESET NOD32 Antivirus.
Same advise. Works flawlessly.
Egbert Jan
Op 18-1-2011 10:41, Nick Lunt schreef:
-----Original Message----- From: dovecot-bounces+nick.lunt=patech-solutions.com@dovecot.org [mailto:dovecot-bounces+nick.lunt=patech-solutions.com@dovecot.org] On Behalf Of Frank Bonnet Sent: 18 January 2011 09:41 To: Dovecot Mailing List Subject: [Dovecot] rotate logs ?
Hello
is there an internal mechanism in dovecot to rotate logs daily ?
thanks
How about putting the something similar to the following in /etc/logrotate.conf (on redhat/centos)
/var/log/dovecot.log { weekly minsize 1M create 0664 root postfix rotate 4 }
Cheers Nick .
__________ Information from ESET NOD32 Antivirus, version of virus signature database 5795 (20110117) __________
The message was checked by ESET NOD32 Antivirus.
On 18.1.2011, at 11.41, Nick Lunt wrote:
How about putting the something similar to the following in /etc/logrotate.conf (on redhat/centos)
/var/log/dovecot.log { weekly minsize 1M create 0664 root postfix rotate 4 }
Be sure to send a SIGUSR1 signal to dovecot process too so that it reopens the logs. (With v2.0 you can use doveadm log reopen.)
On 01/18/2011 10:53 AM, Timo Sirainen wrote:
On 18.1.2011, at 11.41, Nick Lunt wrote:
How about putting the something similar to the following in /etc/logrotate.conf (on redhat/centos)
/var/log/dovecot.log { weekly minsize 1M create 0664 root postfix rotate 4 } Be sure to send a SIGUSR1 signal to dovecot process too so that it reopens the logs. (With v2.0 you can use doveadm log reopen.)
Would this be OK in logrotate.conf ?
kill -HUP cat /var/run/dovecot/master.pid
On 18.1.2011, at 11.59, Frank Bonnet wrote:
Be sure to send a SIGUSR1 signal to dovecot process too so that it reopens the logs. (With v2.0 you can use doveadm log reopen.)
Would this be OK in logrotate.conf ?
kill -HUP
cat /var/run/dovecot/master.pid
It'll rotate the logs, but it'll also re-read the config. I'd use -USR1 instead.
On 01/18/2011 11:42 AM, Timo Sirainen wrote:
On 18.1.2011, at 11.59, Frank Bonnet wrote:
Be sure to send a SIGUSR1 signal to dovecot process too so that it reopens the logs. (With v2.0 you can use doveadm log reopen.)
Would this be OK in logrotate.conf ?
kill -HUP
cat /var/run/dovecot/master.pid
It'll rotate the logs, but it'll also re-read the config. I'd use -USR1 instead.
OK, thank you Timo
On Tue, 18 Jan 2011 11:53:17 +0200, Timo Sirainen <tss@iki.fi> wrote:
Be sure to send a SIGUSR1 signal to dovecot process too so that it reopens the logs. (With v2.0 you can use doveadm log reopen.)
Would this do?
/var/log/dovecot.log { weekly rotate 4 create 600 root root size 64k compress notifempty postrotate [ -f /var/run/dovecot/master.pid ] && kill -USR1 $(cat /var/run/dovecot/master.pid) endscript }
M.
Am 18.01.2011 20:50, schrieb Mark Alan:
On Tue, 18 Jan 2011 11:53:17 +0200, Timo Sirainen <tss@iki.fi> wrote:
Be sure to send a SIGUSR1 signal to dovecot process too so that it reopens the logs. (With v2.0 you can use doveadm log reopen.)
Would this do?
/var/log/dovecot.log { weekly rotate 4 create 600 root root size 64k compress notifempty postrotate [ -f /var/run/dovecot/master.pid ] && kill -USR1 $(cat /var/run/dovecot/master.pid) endscript }
M.
be aware that new /var/log/dovecot.log after rotate is writable to the dovecot user after all i would use daily
logrotate differs a little bit from distro to distro
simply try it
logrotate --help Usage: logrotate [OPTION...] <configfile> -d, --debug Don't do anything, just test (implies -v) -f, --force Force file rotation -m, --mail=command Command to send mail (instead of `/usr/bin/mail') -s, --state=statefile Path of state file -v, --verbose Display messages during rotation
so i.e
logrotate -f -v /etc/logrotate.d/dovecot will help to test
and/or
look http://wiki.dovecot.org/Logging
-- Best Regards
MfG Robert Schetterer
Germany/Munich/Bavaria
On Tue, 18 Jan 2011 21:34:00 +0100 Robert Schetterer <robert@schetterer.org> articulated:
Am 18.01.2011 20:50, schrieb Mark Alan:
On Tue, 18 Jan 2011 11:53:17 +0200, Timo Sirainen <tss@iki.fi> wrote:
Be sure to send a SIGUSR1 signal to dovecot process too so that it reopens the logs. (With v2.0 you can use doveadm log reopen.)
Would this do?
/var/log/dovecot.log { weekly rotate 4 create 600 root root size 64k compress notifempty postrotate [ -f /var/run/dovecot/master.pid ] && kill -USR1 $(cat /var/run/dovecot/master.pid) endscript }
M.
be aware that new /var/log/dovecot.log after rotate is writable to the dovecot user after all i would use daily
logrotate differs a little bit from distro to distro
simply try it
logrotate --help Usage: logrotate [OPTION...] <configfile> -d, --debug Don't do anything, just test (implies -v) -f, --force Force file rotation -m, --mail=command Command to send mail (instead of `/usr/bin/mail') -s, --state=statefile Path of state file -v, --verbose Display messages during rotation
so i.e
logrotate -f -v /etc/logrotate.d/dovecot will help to test
and/or
The following works fine on a FreeBSD system (/etc/newsyslog.conf)
# logfilename [owner:group] mode count size when flags [/pid_file] [sig_num] /var/log/dovecot.log vmail:vmail 664 1 * $M1D0 CJ /var/run/dovecot/master.pid 30
$M1D0 rotate at the first day of every month at midnight (i.e., the start of the day; same as @01T00)
-- Jerry ✌ Dovecot.user@seibercom.net
Disclaimer: off-list followups get on-list replies or get ignored. Please do not ignore the Reply-To header.
“The very powerful and the very stupid have one thing in common. Instead of altering their views to fit the facts, they alter the facts to fit their views...which can be very uncomfortable if you happen to be one of the facts that needs altering.”
- Frank Bonnet <f.bonnet@esiee.fr>:
Hello
is there an internal mechanism in dovecot to rotate logs daily ?
No.
-- Ralf Hildebrandt Geschäftsbereich IT | Abteilung Netzwerk Charité - Universitätsmedizin Berlin Campus Benjamin Franklin Hindenburgdamm 30 | D-12203 Berlin Tel. +49 30 450 570 155 | Fax: +49 30 450 570 962 ralf.hildebrandt@charite.de | http://www.charite.de
participants (8)
-
Egbert Jan van den Bussche
-
Frank Bonnet
-
Jerry
-
Mark Alan
-
Nick Lunt
-
Ralf Hildebrandt
-
Robert Schetterer
-
Timo Sirainen