
This is the Title of the Book, eMatter Edition
Copyright © 2007 O’Reilly & Associates, Inc. All rights reserved.
Intrusion Prevention and Monitoring
|
243
Project 10.4. Tune Up Asterisk’s Logging Configuration
What you need for this project:
• Asterisk
Log analysis should be the core of your daily system monitoring and security activi-
ties. Like other softPBX servers, Asterisk supports flexible logging, providing several
levels of logging detail in several different files. It also supports using syslog.
By default, Asterisk stores its logs in /var/log/asterisk.
Configuration of Asterisk logging is done in the /etc/asterisk/logger.conf file, which
Asterisk reads at boot time or whenever it is started. The first section of the file is
[general], where you can assign a value to the dateformat option to specify what
date format to use in Asterisk’s logs. To figure out the syntax of the date formats,
read the manpage for
strftime( ) by running man strftime.
The next section,
[logfiles], describes which files should be used for logging out-
put, and how detailed each should be. The syntax for this section is:
filename => level,level,level...
Consider the following logging configuration:
[general]
[logfiles]
messages.log => notice,warning,error
debug.log => notice,warning,error,debug,verbose
In this example, messages.log will contain a digest version of Asterisk’s logging out-
put, while debug.log will get everything ...