[Asterisk-Users] asterisk log

Tzafrir Cohen tzafrir at cohens.org.il
Fri Oct 14 21:05:02 MST 2005


On Wed, Oct 12, 2005 at 12:01:17PM +0200, gincantalupo wrote:

> >2) implement a log rotation or similar of the full log ?
> >
> >I see the full log grows a lot (about 100 MB per Month)
> > 
> >
> Use logrotate.

logrotate (which comes with most linux distributions) will indeed save 
you the dirty work of writing the log rotation cron jobs.

You'd still need to command asterisk 'logger reload' just after moving
the log file, or otherwise it will continue to write to the old file.

The current default Debian /etc/logrotate.d/asterisk is:

/var/log/asterisk/cdr-csv/Master.csv /var/log/asterisk/debug /var/log/asterisk/event_log /var/log/asterisk/messages {
        weekly
        missingok
        rotate 4
        sharedscripts
        postrotate
                /usr/sbin/invoke-rc.d asterisk logger-reload
        endscript
}


-- 
Tzafrir Cohen         | tzafrir at jbr.cohens.org.il | VIM is
http://tzafrir.org.il |                           | a Mutt's  
tzafrir at cohens.org.il |                           |  best
ICQ# 16849755         |                           | friend



More information about the asterisk-users mailing list