Logging
Last updated
Last updated
Copyright 2013-2024 60East Technologies, Inc.
AMPS supports several different types of log formats, and multiple targets can be defined simultaneously.
For details on logging, including a cross reference to the types of message and a breakdown of the format AMPS uses in log messages, see the Logging section of the AMPS User Guide.
The following table lists the configuration elements that apply to all logging protocols:
AMPS logging is always opt-in. That is, no messages are logged to a target by default. Logging must be explicitly requested using the configuration elements above.
The following tabs list information that is only relevant for specific protocols.
Element
Description
Protocol
(required)
Define the logging target protocol
Valid values: stdout, stderr, file, gzip, syslog
Level
Defines a lower bound (inclusive) log level for logging. All log messages at the specified level and up are logged.
A production server should be configured to log at info
level or more verbose.
There is no default for this option.
Valid values: none
, developer
, trace
, stats
, info
, warning
, error
, critical
, emergency
Levels
A comma separated list of specific log levels. Only log messages at the specified levels will be logged.
This element can be used with the Level
element. In that case, the AMPS will log all messages at Level
and above, and in addition, will log errors at the levels specified by Levels
.
There is no default for this option.
Valid values: developer
, trace
, stats
, info
, warning
, error
, critical
, emergency
, none
IncludeErrors
Additional errors that should be included when logging. If an error appears in this element, it will be logged regardless of the level of the error. There is no default for this option.
This element accepts a comma-delimited list of error numbers. You can also provide a regular expression that matches a set of errors, such as 12-.*
ExcludeErrors
Errors that should be excluded when logging. If an error appears in this element, it will not be logged regardless of the level of the error. There is no default for this option.
If the same error appears in both IncludeErrors
and ExcludeErrors
, ExcludeErrors
takes precedence, and the error will not be logged.
This element accepts a comma-delimited list of error numbers. You can also provide a regular expression that matches a set of errors, such as 12-.*
Element
Description
FileName
File to log to. If the protocol is gzip, then .gz
is added to the file name.
Required for file
and gzip
protocols.
Default: ${PWD}/%Y-%m-%dT%H%M%S.log
RotationThreshold
Log size at which log rotation will occur. See Byte Units for details on specifying file size.
Element
Description
Ident
Syslog identifier for the AMPS instance.
Default: AMPS Instance Name
Options
A comma separated list of syslog options.
If using syslog
, 60East recommends using LOG_CONS
, LOG_NDELAY
, and LOG_PID
.
AMPS uses the standard options to syslog, as described in the syslog man page.
Facility
Syslog facility to use.