| 
									
										
										
										
											2002-02-11 04:25:04 +00:00
										 |  |  | ; | 
					
						
							|  |  |  | ; Logging Configuration | 
					
						
							|  |  |  | ; | 
					
						
							| 
									
										
										
										
											2004-01-28 21:13:50 +00:00
										 |  |  | ; In this file, you configure logging to files or to | 
					
						
							|  |  |  | ; the syslog system. | 
					
						
							| 
									
										
										
										
											2005-03-17 15:56:55 +00:00
										 |  |  | ; | 
					
						
							|  |  |  | ; "logger reload" at the CLI will reload configuration | 
					
						
							|  |  |  | ; of the logging system. | 
					
						
							| 
									
										
										
										
											2004-05-18 05:47:27 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  | [general] | 
					
						
							| 
									
										
										
										
											2007-08-17 16:39:41 +00:00
										 |  |  | ; | 
					
						
							| 
									
										
										
										
											2004-05-18 05:47:27 +00:00
										 |  |  | ; Customize the display of debug message time stamps | 
					
						
							|  |  |  | ; this example is the ISO 8601 date format (yyyy-mm-dd HH:MM:SS) | 
					
						
							| 
									
										
										
										
											2007-08-17 16:39:41 +00:00
										 |  |  | ; | 
					
						
							|  |  |  | ; see strftime(3) Linux manual for format specifiers.  Note that there is also | 
					
						
							|  |  |  | ; a fractional second parameter which may be used in this field.  Use %1q | 
					
						
							|  |  |  | ; for tenths, %2q for hundredths, etc. | 
					
						
							| 
									
										
										
										
											2009-05-28 14:39:21 +00:00
										 |  |  | ; | 
					
						
							| 
									
										
										
										
											2007-08-17 16:39:41 +00:00
										 |  |  | ;dateformat=%F %T       ; ISO 8601 date format | 
					
						
							|  |  |  | ;dateformat=%F %T.%3q   ; with milliseconds | 
					
						
							| 
									
										
										
										
											2004-09-05 03:48:05 +00:00
										 |  |  | ; | 
					
						
							| 
									
										
										
										
											2012-03-29 20:01:20 +00:00
										 |  |  | ; | 
					
						
							|  |  |  | ; This makes Asterisk write callids to log messages | 
					
						
							|  |  |  | ; (defaults to yes) | 
					
						
							|  |  |  | ;use_callids = no | 
					
						
							|  |  |  | ; | 
					
						
							| 
									
										
										
										
											2004-09-05 03:48:05 +00:00
										 |  |  | ; This appends the hostname to the name of the log files. | 
					
						
							|  |  |  | ;appendhostname = yes | 
					
						
							|  |  |  | ; | 
					
						
							| 
									
										
										
										
											2005-10-04 22:51:59 +00:00
										 |  |  | ; This determines whether or not we log queue events to a file | 
					
						
							|  |  |  | ; (defaults to yes). | 
					
						
							| 
									
										
										
										
											2005-03-11 08:49:01 +00:00
										 |  |  | ;queue_log = no | 
					
						
							|  |  |  | ; | 
					
						
							| 
									
										
										
										
											2010-07-20 23:23:25 +00:00
										 |  |  | ; Determines whether the queue_log always goes to a file, even | 
					
						
							|  |  |  | ; when a realtime backend is present (defaults to no). | 
					
						
							|  |  |  | ;queue_log_to_file = yes | 
					
						
							|  |  |  | ; | 
					
						
							| 
									
										
										
										
											2006-09-26 17:09:01 +00:00
										 |  |  | ; Set the queue_log filename | 
					
						
							|  |  |  | ; (defaults to queue_log) | 
					
						
							|  |  |  | ;queue_log_name = queue_log | 
					
						
							|  |  |  | ; | 
					
						
							| 
									
										
										
										
											2013-01-28 01:50:54 +00:00
										 |  |  | ; When using realtime for the queue log, use GMT for the timestamp | 
					
						
							|  |  |  | ; instead of localtime.  The default of this option is 'no'. | 
					
						
							|  |  |  | ;queue_log_realtime_use_gmt = yes | 
					
						
							|  |  |  | ; | 
					
						
							| 
									
										
										
										
											2007-08-28 20:03:48 +00:00
										 |  |  | ; Log rotation strategy: | 
					
						
							| 
									
										
										
										
											2012-09-12 17:13:02 +00:00
										 |  |  | ; none:  Do not perform any logrotation at all.  You should make | 
					
						
							|  |  |  | ;        very sure to set up some external logrotate mechanism | 
					
						
							|  |  |  | ;        as the asterisk logs can get very large, very quickly. | 
					
						
							| 
									
										
										
										
											2007-08-28 20:03:48 +00:00
										 |  |  | ; sequential:  Rename archived logs in order, such that the newest | 
					
						
							| 
									
										
										
										
											2010-07-20 23:23:25 +00:00
										 |  |  | ;              has the highest sequence number [default].  When | 
					
						
							|  |  |  | ;              exec_after_rotate is set, ${filename} will specify | 
					
						
							|  |  |  | ;              the new archived logfile. | 
					
						
							| 
									
										
										
										
											2007-08-28 20:03:48 +00:00
										 |  |  | ; rotate:  Rotate all the old files, such that the oldest has the | 
					
						
							|  |  |  | ;          highest sequence number [this is the expected behavior | 
					
						
							| 
									
										
										
										
											2010-07-20 23:23:25 +00:00
										 |  |  | ;          for Unix administrators].  When exec_after_rotate is | 
					
						
							|  |  |  | ;          set, ${filename} will specify the original root filename. | 
					
						
							| 
									
										
										
										
											2007-08-28 20:03:48 +00:00
										 |  |  | ; timestamp:  Rename the logfiles using a timestamp instead of a | 
					
						
							|  |  |  | ;             sequence number when "logger rotate" is executed. | 
					
						
							| 
									
										
										
										
											2010-07-20 23:23:25 +00:00
										 |  |  | ;             When exec_after_rotate is set, ${filename} will | 
					
						
							|  |  |  | ;             specify the new archived logfile. | 
					
						
							| 
									
										
										
										
											2007-08-28 20:03:48 +00:00
										 |  |  | ;rotatestrategy = rotate | 
					
						
							|  |  |  | ; | 
					
						
							|  |  |  | ; Run a system command after rotating the files.  This is mainly | 
					
						
							|  |  |  | ; useful for rotatestrategy=rotate. The example allows the last | 
					
						
							|  |  |  | ; two archive files to remain uncompressed, but after that point, | 
					
						
							|  |  |  | ; they are compressed on disk. | 
					
						
							|  |  |  | ; | 
					
						
							|  |  |  | ; exec_after_rotate=gzip -9 ${filename}.2 | 
					
						
							| 
									
										
										
										
											2006-10-02 17:54:21 +00:00
										 |  |  | ; | 
					
						
							| 
									
										
										
										
											2004-01-28 21:13:50 +00:00
										 |  |  | ; | 
					
						
							|  |  |  | ; For each file, specify what to log. | 
					
						
							|  |  |  | ; | 
					
						
							|  |  |  | ; For console logging, you set options at start of | 
					
						
							|  |  |  | ; Asterisk with -v for verbose and -d for debug | 
					
						
							|  |  |  | ; See 'asterisk -h' for more information. | 
					
						
							|  |  |  | ; | 
					
						
							|  |  |  | ; Directory for log files is configures in asterisk.conf | 
					
						
							|  |  |  | ; option astlogdir | 
					
						
							|  |  |  | ; | 
					
						
							| 
									
										
										
										
											2017-05-08 15:11:19 -06:00
										 |  |  | ; All log messages go to a queue serviced by a single thread | 
					
						
							|  |  |  | ; which does all the IO.  This setting controls how big that | 
					
						
							|  |  |  | ; queue can get (and therefore how much memory is allocated) | 
					
						
							|  |  |  | ; before new messages are discarded. | 
					
						
							|  |  |  | ; The default is 1000 | 
					
						
							|  |  |  | ;logger_queue_limit = 250 | 
					
						
							|  |  |  | ; | 
					
						
							| 
									
										
										
										
											2021-07-25 22:19:08 +00:00
										 |  |  | ; Any custom logging levels you may want to use, which can then | 
					
						
							|  |  |  | ; be sent to logging channels. The maximum number of custom | 
					
						
							|  |  |  | ; levels is 16, but not all of these may be available if modules | 
					
						
							|  |  |  | ; in Asterisk define their own. | 
					
						
							|  |  |  | ;custom_levels = foobar,important,compliance | 
					
						
							| 
									
										
										
										
											2017-05-08 15:11:19 -06:00
										 |  |  | ; | 
					
						
							| 
									
										
										
										
											2002-02-11 04:25:04 +00:00
										 |  |  | [logfiles] | 
					
						
							|  |  |  | ; | 
					
						
							| 
									
										
											  
											
												main/logger: Add log formatters and JSON structured logs
When Asterisk is part of a larger distributed system, log files are often
gathered using tools (such as logstash) that prefer to consume information
and have it rendered using other tools (such as Kibana) that prefer a
structured format, e.g., JSON. This patch adds support for JSON formatted
logs by adding support for an optional log format specifier in Asterisk's
logging subsystem. By adding a format specifier of '[json]':
full => [json]debug,verbose,notice,warning,error
Log messages will be output to the 'full' channel in the following
format:
{
  "hostname": Hostname or name specified in asterisk.conf
  "timestamp": Date/Time
  "identifiers": {
    "lwp": Thread ID,
    "callid": Call Identifier
  }
  "logmsg": {
    "location": {
      "filename": Name of the file that generated the log statement
      "function": Function that generated the log statement
      "line": Line number that called the logging function
    }
    "level": Log level, e.g., DEBUG, VERBOSE, etc.
    "message": Actual text of the log message
  }
}
ASTERISK-25425 #close
Change-Id: I8649bfedf3fb7bf3138008cc11565553209cc238
											
										 
											2015-09-21 07:26:00 -05:00
										 |  |  | ; Format is: | 
					
						
							|  |  |  | ; | 
					
						
							|  |  |  | ; logger_name => [formatter]levels | 
					
						
							|  |  |  | ; | 
					
						
							|  |  |  | ; The name of the logger dictates not only the name of the logging | 
					
						
							|  |  |  | ; channel, but also its type. Valid types are: | 
					
						
							|  |  |  | ;   - 'console'  - The root console of Asterisk | 
					
						
							|  |  |  | ;   - 'syslog'   - Linux syslog, with facilities specified afterwards with | 
					
						
							|  |  |  | ;                  a period delimiter, e.g., 'syslog.local0' | 
					
						
							|  |  |  | ;   - 'filename' - The name of the log file to create. This is the default | 
					
						
							|  |  |  | ;                  for log channels. | 
					
						
							|  |  |  | ; | 
					
						
							|  |  |  | ; Filenames can either be relative to the standard Asterisk log directory | 
					
						
							|  |  |  | ; (see 'astlogdir' in asterisk.conf), or absolute paths that begin with | 
					
						
							|  |  |  | ; '/'. | 
					
						
							|  |  |  | ; | 
					
						
							|  |  |  | ; An optional formatter can be specified prior to the log levels sent | 
					
						
							|  |  |  | ; to the log channel. The formatter is defined immediately preceeding the | 
					
						
							|  |  |  | ; levels, and is enclosed in square brackets. Valid formatters are: | 
					
						
							|  |  |  | ;   - [default] - The default formatter, this outputs log messages using a | 
					
						
							|  |  |  | ;                 human readable format. | 
					
						
							| 
									
										
										
										
											2020-08-14 10:13:33 -06:00
										 |  |  | ;   - [plain]   - The plain formatter, this outputs log messages using a | 
					
						
							|  |  |  | ;                 human readable format with the addition of function name | 
					
						
							|  |  |  | ;                 and line number. No color escape codes are ever printed | 
					
						
							| 
									
										
										
										
											2020-10-12 01:45:44 -04:00
										 |  |  | ;                 nor are verbose messages treated specially. | 
					
						
							| 
									
										
											  
											
												main/logger: Add log formatters and JSON structured logs
When Asterisk is part of a larger distributed system, log files are often
gathered using tools (such as logstash) that prefer to consume information
and have it rendered using other tools (such as Kibana) that prefer a
structured format, e.g., JSON. This patch adds support for JSON formatted
logs by adding support for an optional log format specifier in Asterisk's
logging subsystem. By adding a format specifier of '[json]':
full => [json]debug,verbose,notice,warning,error
Log messages will be output to the 'full' channel in the following
format:
{
  "hostname": Hostname or name specified in asterisk.conf
  "timestamp": Date/Time
  "identifiers": {
    "lwp": Thread ID,
    "callid": Call Identifier
  }
  "logmsg": {
    "location": {
      "filename": Name of the file that generated the log statement
      "function": Function that generated the log statement
      "line": Line number that called the logging function
    }
    "level": Log level, e.g., DEBUG, VERBOSE, etc.
    "message": Actual text of the log message
  }
}
ASTERISK-25425 #close
Change-Id: I8649bfedf3fb7bf3138008cc11565553209cc238
											
										 
											2015-09-21 07:26:00 -05:00
										 |  |  | ;   - [json]    - Log the output in JSON. Note that JSON formatted log entries, | 
					
						
							|  |  |  | ;                 if specified for a logger type of 'console', will be formatted | 
					
						
							|  |  |  | ;                 per the 'default' formatter for log messages of type VERBOSE. | 
					
						
							| 
									
										
										
										
											2021-10-30 21:04:38 -04:00
										 |  |  | ;                 This is due to the remote consoles interpreting verbosity | 
					
						
							| 
									
										
											  
											
												main/logger: Add log formatters and JSON structured logs
When Asterisk is part of a larger distributed system, log files are often
gathered using tools (such as logstash) that prefer to consume information
and have it rendered using other tools (such as Kibana) that prefer a
structured format, e.g., JSON. This patch adds support for JSON formatted
logs by adding support for an optional log format specifier in Asterisk's
logging subsystem. By adding a format specifier of '[json]':
full => [json]debug,verbose,notice,warning,error
Log messages will be output to the 'full' channel in the following
format:
{
  "hostname": Hostname or name specified in asterisk.conf
  "timestamp": Date/Time
  "identifiers": {
    "lwp": Thread ID,
    "callid": Call Identifier
  }
  "logmsg": {
    "location": {
      "filename": Name of the file that generated the log statement
      "function": Function that generated the log statement
      "line": Line number that called the logging function
    }
    "level": Log level, e.g., DEBUG, VERBOSE, etc.
    "message": Actual text of the log message
  }
}
ASTERISK-25425 #close
Change-Id: I8649bfedf3fb7bf3138008cc11565553209cc238
											
										 
											2015-09-21 07:26:00 -05:00
										 |  |  | ;                 outside of the logging subsystem. | 
					
						
							|  |  |  | ; | 
					
						
							|  |  |  | ; Log levels include the following, and are specified in a comma delineated | 
					
						
							|  |  |  | ; list: | 
					
						
							| 
									
										
										
										
											2002-02-11 04:25:04 +00:00
										 |  |  | ;    debug | 
					
						
							| 
									
										
										
										
											2020-05-14 12:24:19 -06:00
										 |  |  | ;    trace | 
					
						
							| 
									
										
										
										
											2002-02-11 04:25:04 +00:00
										 |  |  | ;    notice | 
					
						
							|  |  |  | ;    warning | 
					
						
							|  |  |  | ;    error | 
					
						
							| 
									
										
										
										
											2012-02-14 20:27:16 +00:00
										 |  |  | ;    verbose(<level>) | 
					
						
							| 
									
										
										
										
											2005-08-22 21:19:59 +00:00
										 |  |  | ;    dtmf | 
					
						
							| 
									
										
										
										
											2010-07-26 19:58:12 +00:00
										 |  |  | ;    fax | 
					
						
							| 
									
										
										
										
											2011-09-22 16:35:20 +00:00
										 |  |  | ;    security | 
					
						
							| 
									
										
										
										
											2021-07-25 22:19:08 +00:00
										 |  |  | ;    <customlevel> | 
					
						
							| 
									
										
										
										
											2002-02-11 04:25:04 +00:00
										 |  |  | ; | 
					
						
							| 
									
										
										
										
											2021-03-24 10:52:30 -05:00
										 |  |  | ; Verbose takes an optional argument, in the form of an integer level. The | 
					
						
							|  |  |  | ; verbose level can be set per logfile. Verbose messages with higher levels | 
					
						
							|  |  |  | ; will not be logged to the file.  If the verbose level is not specified, it | 
					
						
							|  |  |  | ; will log verbose messages following the current level of the root console. | 
					
						
							|  |  |  | ; | 
					
						
							|  |  |  | ; Debug has multiple levels like verbose. However, it is a system wide setting | 
					
						
							|  |  |  | ; and cannot be specified per logfile. You specify the debug level elsewhere | 
					
						
							|  |  |  | ; such as the CLI 'core set debug 3', starting Asterisk with '-ddd', or in | 
					
						
							|  |  |  | ; asterisk.conf 'debug=3'. | 
					
						
							| 
									
										
										
										
											2014-01-14 18:14:02 +00:00
										 |  |  | ; | 
					
						
							| 
									
										
										
										
											2010-05-19 15:29:28 +00:00
										 |  |  | ; Special level name "*" means all levels, even dynamic levels registered | 
					
						
							|  |  |  | ; by modules after the logger has been initialized (this means that loading | 
					
						
							|  |  |  | ; and unloading modules that create/remove dynamic logger levels will result | 
					
						
							|  |  |  | ; in these levels being included on filenames that have a level name of "*", | 
					
						
							| 
									
										
										
										
											2014-01-14 18:14:02 +00:00
										 |  |  | ; without any need to perform a 'logger reload' or similar operation). | 
					
						
							|  |  |  | ; Note that there is no value in specifying both "*" and specific level names | 
					
						
							|  |  |  | ; for a filename; the "*" level means all levels.  The only exception is if | 
					
						
							|  |  |  | ; you need to specify a specific verbose level. e.g, "verbose(3),*". | 
					
						
							| 
									
										
										
										
											2012-02-14 20:27:16 +00:00
										 |  |  | ; | 
					
						
							| 
									
										
										
										
											2005-10-04 22:51:59 +00:00
										 |  |  | ; We highly recommend that you DO NOT turn on debug mode if you are simply | 
					
						
							|  |  |  | ; running a production system.  Debug mode turns on a LOT of extra messages, | 
					
						
							|  |  |  | ; most of which you are unlikely to understand without an understanding of | 
					
						
							|  |  |  | ; the underlying code.  Do NOT report debug messages as code issues, unless | 
					
						
							|  |  |  | ; you have a specific issue that you are attempting to debug.  They are | 
					
						
							|  |  |  | ; messages for just that -- debugging -- and do not rise to the level of | 
					
						
							| 
									
										
										
										
											2020-05-14 12:24:19 -06:00
										 |  |  | ; something that merit your attention as an Asterisk administrator.  Both | 
					
						
							|  |  |  | ; debug and trace messages are also very verbose and can and do fill up | 
					
						
							|  |  |  | ; logfiles quickly.  This is another reason not to have debug or trace | 
					
						
							|  |  |  | ; modes on a production system unless you are in the process of debugging | 
					
						
							|  |  |  | ; a specific issue. | 
					
						
							| 
									
										
										
										
											2005-07-20 00:16:15 +00:00
										 |  |  | ; | 
					
						
							| 
									
										
										
										
											2002-02-11 04:25:04 +00:00
										 |  |  | ;debug => debug | 
					
						
							| 
									
										
										
										
											2020-05-14 12:24:19 -06:00
										 |  |  | ;trace => trace | 
					
						
							| 
									
										
										
										
											2011-09-22 16:35:20 +00:00
										 |  |  | ;security => security | 
					
						
							| 
									
										
										
										
											2002-02-11 04:25:04 +00:00
										 |  |  | console => notice,warning,error | 
					
						
							| 
									
										
										
										
											2003-09-28 20:05:12 +00:00
										 |  |  | ;console => notice,warning,error,debug | 
					
						
							| 
									
										
										
										
											2002-02-11 04:25:04 +00:00
										 |  |  | messages => notice,warning,error | 
					
						
							| 
									
										
										
										
											2010-07-26 19:58:12 +00:00
										 |  |  | ;full => notice,warning,error,debug,verbose,dtmf,fax | 
					
						
							| 
									
										
											  
											
												main/logger: Add log formatters and JSON structured logs
When Asterisk is part of a larger distributed system, log files are often
gathered using tools (such as logstash) that prefer to consume information
and have it rendered using other tools (such as Kibana) that prefer a
structured format, e.g., JSON. This patch adds support for JSON formatted
logs by adding support for an optional log format specifier in Asterisk's
logging subsystem. By adding a format specifier of '[json]':
full => [json]debug,verbose,notice,warning,error
Log messages will be output to the 'full' channel in the following
format:
{
  "hostname": Hostname or name specified in asterisk.conf
  "timestamp": Date/Time
  "identifiers": {
    "lwp": Thread ID,
    "callid": Call Identifier
  }
  "logmsg": {
    "location": {
      "filename": Name of the file that generated the log statement
      "function": Function that generated the log statement
      "line": Line number that called the logging function
    }
    "level": Log level, e.g., DEBUG, VERBOSE, etc.
    "message": Actual text of the log message
  }
}
ASTERISK-25425 #close
Change-Id: I8649bfedf3fb7bf3138008cc11565553209cc238
											
										 
											2015-09-21 07:26:00 -05:00
										 |  |  | ; | 
					
						
							|  |  |  | ;full-json => [json]debug,verbose,notice,warning,error,dtmf,fax | 
					
						
							|  |  |  | ; | 
					
						
							| 
									
										
										
										
											2009-05-28 14:39:21 +00:00
										 |  |  | ;syslog keyword : This special keyword logs to syslog facility | 
					
						
							| 
									
										
										
										
											2003-11-26 22:00:07 +00:00
										 |  |  | ; | 
					
						
							| 
									
										
										
										
											2004-01-12 05:05:35 +00:00
										 |  |  | ;syslog.local0 => notice,warning,error | 
					
						
							|  |  |  | ; | 
					
						
							| 
									
										
										
										
											2021-07-25 22:19:08 +00:00
										 |  |  | ; A log level defined in 'custom_levels' above | 
					
						
							|  |  |  | ;important.log = important |