Re: log rotation recommendations

2007-03-24 Thread Roger Olofsson

Hello Jeffrey,

I am not familiar with logrotate but my newsyslog.conf rotates whatever 
I want just fine. As an example I have this for a small almost unused 
apache:


/var/log/httpd-access.log   644  7 1000 24B 
/var/run/httpd.pid 30
/var/log/httpd-error.log644  7 1000 24B 
/var/run/httpd.pid 30


You might want to adjust size settings etc and this can be found in the 
man page for newsyslog.conf.


Good luck!



Jeffrey Goldberg skrev:

Hello,

Having recently moved from Linux (SuSE) to FreeBSD (6.2-p3) I'm 
wondering what the recommended way of rotating logs (principally postfix 
and apache).  I see that logrotate, with which I'm familiar, is in 
ports.  I also see that there is a file /etc/newsyslog.conf, but it 
looks like newsyslog(8) only knows about HUPping syslogd.


If there is no conventional "BSD way of doing this", I'll just install 
logrotate and go with what I know, but I thought I would check here first.


Thanks,

-j


--Jeffrey Goldberghttp://www.goldmark.org/jeff/

___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to 
"[EMAIL PROTECTED]"



--No virus found in this incoming message.
Checked by AVG Free Edition.
Version: 7.5.446 / Virus Database: 268.18.17/731 - Release Date: 
2007-03-23 15:27




___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "[EMAIL PROTECTED]"


Re: log rotation recommendations

2007-03-24 Thread Lars Kristiansen

Matthew Seaman skrev:

Jeffrey Goldberg wrote:


Having recently moved from Linux (SuSE) to FreeBSD (6.2-p3) I'm
wondering what the recommended way of rotating logs (principally postfix
and apache).  I see that logrotate, with which I'm familiar, is in
ports.  I also see that there is a file /etc/newsyslog.conf, but it
looks like newsyslog(8) only knows about HUPping syslogd.


Not so.  The optional 7th field in /etc/newsyslog.conf can contain a
file name to read a PID out of: that PID will be signalled when the
log is rotated. The optional 8th column can contain the signal number
to use -- by default SIGHUP is sent.  The newsyslog.conf(5) man page
explains all this in great detail.

Certainly for apache, you might alternatively consider the use of
rotatelogs(8) (comes with apache) or cronolog(8) (in ports as
sysutils/cronolog).  Or, indeed, logrotate if that's what you prefer.


It is also possible to put a call for newsyslog within a script.
Then you can do your preferred preprocessing,
call newsyslog with a specialized config for the event,
which should take care of HUPing the application,
and then do postprocessing like moving files to folders,
renaming to include the date or whatever.

Regards,
Lars


Cheers,

Matthew



___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "[EMAIL PROTECTED]"


Re: log rotation recommendations

2007-03-24 Thread Matthew Seaman
Jeffrey Goldberg wrote:

> Having recently moved from Linux (SuSE) to FreeBSD (6.2-p3) I'm
> wondering what the recommended way of rotating logs (principally postfix
> and apache).  I see that logrotate, with which I'm familiar, is in
> ports.  I also see that there is a file /etc/newsyslog.conf, but it
> looks like newsyslog(8) only knows about HUPping syslogd.

Not so.  The optional 7th field in /etc/newsyslog.conf can contain a
file name to read a PID out of: that PID will be signalled when the
log is rotated. The optional 8th column can contain the signal number
to use -- by default SIGHUP is sent.  The newsyslog.conf(5) man page
explains all this in great detail.

Certainly for apache, you might alternatively consider the use of
rotatelogs(8) (comes with apache) or cronolog(8) (in ports as
sysutils/cronolog).  Or, indeed, logrotate if that's what you prefer.

Cheers,

Matthew

-- 
Dr Matthew J Seaman MA, D.Phil.   7 Priory Courtyard
  Flat 3
PGP: http://www.infracaninophile.co.uk/pgpkey Ramsgate
  Kent, CT11 9PW



signature.asc
Description: OpenPGP digital signature