Claim your Biolink Click Here
0 like 0 dislike
1.3k views
I want to run log files messages and full by datewaise in asterisk
in Education & Reference by (280 points) | 1.3k views

1 Answer

0 like 0 dislike

Asterisk has 5 different main log files:

  1. /var/logs/asterisk/messages
  2. /var/logs/asterisk/queue_log
  3. /var/logs/asterisk/event_log
  4. /var/logs/asterisk/debug
  5. /var/logs/asterisk/full

Here are some parameters description:

  • missingok: If the log file is missing, go on to the next log file without issuing an error message.
  • copytruncate: Truncate the original log file to zero size in place after creating a copy, instead of moving the old log file and optionally creating a new one
  • rotate 7: Log files are rotated 7 times before being removed or mailed to the address specified in a mail directive. If count is 0, old versions are removed rather then rotated.
  • compress: Old versions of log files are compressed with gzip to save disk space.
  • size: Rotate only if the log file reaches the specified limit
  • notifempty: Do not rotate the log if it is empty
  • sharedscripts
    postrotate
    /etc/init.d/lighttpd reload
    endscript:
    The lines between postrotate and endscript (both of which must appear on lines by themselves) are executed after the log file is rotated. These directives may only appear inside a log file definition. In our case we are reloading lighttpd. Other opting could be send –HUP single using kill command.

There are different ways you can configure the rotation:

/var/log/asterisk/full {
   rotate 7
   daily
   create 0640 asterisk asterisk
   postrotate
       /usr/sbin/asterisk -rx 'logger reload' > /dev/null 2> /dev/null
   endscript
}
 
/var/log/asterisk/messages {
   rotate 12
   weekly
   create 0640 asterisk asterisk
   postrotate
       /usr/sbin/asterisk -rx 'logger reload' > /dev/null 2> /dev/null
   endscript
}
by

Related questions

0 like 0 dislike
1 answer
0 like 0 dislike
1 answer
0 like 0 dislike
1 answer
0 like 0 dislike
1 answer
1 like 0 dislike
1 answer
0 like 0 dislike
1 answer
0 like 0 dislike
1 answer
0 like 0 dislike
1 answer
asked Sep 24, 2017 in Education & Reference by Sam (1.6k points) | 1.6k views
2 like 0 dislike
2 answers

Where your donation goes
Technology: We will utilize your donation for development, server maintenance and bandwidth management, etc for our site.

Employee and Projects: We have only 15 employees. They are involved in a wide sort of project works. Your valuable donation will definitely boost their work efficiency.

How can I earn points?
Awarded a Best Answer 10 points
Answer questions 10 points
Asking Question -20 points

1,312 questions
1,473 answers
569 comments
4,809 users