Message Levels

AMPS has nine log levels of escalating severity. When configuring a logging target to capture messages for a specific log level, all log levels at or above that level are sent to the logging target. For example, if a logging target is configured to capture at the “error” level, then all messages at the “error”, “critical”, and “emergency” levels will be captured because “critical” and “emergency” are of a higher level.

The following table contains a list of all the log levels within AMPS:

Level

Description

developer

Information on the internal state of AMPS, typically used by the AMPS developers.

Messages logged at this level do not indicate issues, but instead report the detailed state of the AMPS process.

trace

All inbound/outbound data.

Development and test instances are recommended to log at this level.

stats

Statistics messages.

info

General information messages.

Production applications are recommended to log at this level or more verbose.

warning

Problems that AMPS tries to correct that are often harmless.

error

Events in which processing had to be aborted.

Events at this level often indicate that a client will receive incomplete or incorrect results (for example, a subscription could not be entered because an unknown option was provided).

critical

Events impacting major components of AMPS that if left uncorrected may cause a fatal event or message loss.

emergency

A fatal event.

AMPS will typically exit after logging an emergency-level event.

none

No logging, even in the case of a critical or fatal event.

Each logging target allows the specification of a Level attribute that will log all messages at the specified log level or with higher severity. The default Level is none, which would log nothing. Optionally, each target also allows the selection of specific log levels with the Levels attribute. Within Levels, a comma separated list of levels will be additionally included.

For example, having a log of only trace messages may be useful for later playback, but since trace is at the lowest level in the severity hierarchy it would normally include all log messages. To only enable trace level, specify trace in the Levels setting as below:

<AMPSConfig>
    ...
    <Logging>
        <Target>
            <Protocol>gzip</Protocol>
            <FileName>traces.log.gz</FileName>
            <Levels>trace</Levels>
        </Target>
    </Logging>
    ...
</AMPSConfig>

Logging only trace and info messages to a file is demonstrated below:

<AMPSConfig>
    ...
    <Logging>
    <Target>
            <Protocol>file</Protocol>
            <FileName>traces-info.log</FileName>
            <Levels>trace,info</Levels>
        </Target>
    </Logging>
    ...
</AMPSConfig>

Logging trace and info messages in addition to levels of error and above (error, critical and emergency) is demonstrated below:

<Target>
    <Protocol>file</Protocol>
    <FileName>traces-error-info.log</FileName>
    <Level>error</Level>
    <Levels>trace,info</Levels>
</Target>

AMPS accepts the obsolete log level debug although no such log level is present in current versions of AMPS. If this level is specified, AMPS will treat this as a synonym for info.

Last updated

Copyright 2013-2024 60East Technologies, Inc.