8. LoggingΒΆ
AMPS supports several different types of log formats, and multiple targets can be defined simultaneously.
Element | Description |
---|---|
Protocol
|
Define the logging target protocol Valid values:
|
FileName |
File to log to. If the protocol is gzip, then
Required for Default: |
RotationThreshold |
Log size at which log rotation will occur. See Table 1.3 for details on specifying file size. |
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 Valid values: |
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
Valid values: |
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. 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
|
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. If the same error appears in both
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
|
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. |
Logging Parameters
<Logging>
<!-- trace messages to files in /var/tmp/ -->
<Target>
<Protocol>file</Protocol>
<FileName>/var/tmp/amps/logs/%Y%m%d%H%M%S-%n.log</FileName>
<RotationThreshold>2G</RotationThreshold>
<Level>trace</Level>
<Levels>critical</Levels>
</Target>
<!-- Record critical messages to the system logger. -->
<Target>
<Protocol>syslog</Protocol>
<Level>critical</Level>
<Ident>amps_dma</Ident>
<Options>LOG_CONS,LOG_NDELAY,LOG_PID</Options>
<Facility>LOG_USER</Facility>
</Target>
<!-- record only the AMPS initialization message -->
<Target>
<Protocol>file</Protocol>
<FileName>/var/tmp/amps/logs/initMessage</FileName>
<IncludeErrors>00-0015</IncludeErrors>
</Target>
</Logging>
Logging Example