Settings.xml file - logging elements

The following table describes the logging elements that you need to configure in the settings.xml file for XPS to integrate with N4. If you omit this element, a standard "managed" logger is used to log all primary XPS log output. If you supply this element, it completely defines the logging environment.

The logging element consists of logger elements which are defined and written to the appender element. This allows you to have different log levels for different output and keep them in the same output file.

The default logging configuration corresponds to the following XML:

<logging>

    <appender name="main" kind="managed" prefix="xps" />

    <logger name="default" level="60" appender="main" />

    <logger name="messages" level="80" appender="main" />

</logging>

The appender describes where the output is written to physically. For example, it can write to the console, to a file, or to a set of rolling files. If no appender is defined, the default is to write to the console.

Appender Elements in settings.xml

Element

Description

Values

Example Section

name

The name of the appender which the "<logger>" tag can refer to.

Any text.

<appender name="main" kind="managed" prefix="xps" />

 

 

kind

The type of appender.

  • cout writes to the console.

  • silent discards any output.

  • managed writes to files that are named with timestamps.

prefix

The prefix for the log file names.

Any text. The default is "xps".

dir

The subdirectory where files are written.

Any directory. The default is "log".

linelimit

The file size limit in number of log statements (not counting stack trace lines).

Integer. The default is 10000.

lifedays

The number of days a managed appender's closed old log file will remain on disk before being deleted.

Integer. The default is 30.

 

The logger element provides one or more logger definitions inside the <logging> element. For N4, you need to define at least the default logger.

Logger Elements in settings.xml

Element

Description

Values

Example Section

name

The unique name of the logger. XPS logs output to loggers by name, so by using particular names you can route certain log output to a given logger. If XPS logs to a named logger that does not exist, the output goes to the default logger (name = "default", or the first logger if there is none named "default").

 

Some named loggers where XPS logs to:

  • "messages" - The XPS client and N4 Gate XML message traffic

  • "persister" - N4 bridge persister activity

  • "ec" - equipment control activity

  • "pds" - position detection system activity

  • "adb" - activities database i/o

  • "radio" - RDT traffic

  • "netlog" - netlog traffic

Example of writing to multiple appenders:

<logging>

    <appender name="myfile" kind="file" path="myoutput.log" />

    <appender name="console" kind="cout" />

    <logger name="default" level="60">

        <appender name="myfile" />

        <appender name="console" />

    </logger>

</logging>

 

level

The logging level used for any loggers you define here and for which you do not specify the log level.

Possible values are 0-100, where the following numeric values have common meanings:

  • 0=OFF. Suppresses all output.

  • 1=FATAL. Indicates an unsurvivable error.

  • 20=ERROR. Indicates a problem.

  • 40=WARN. Indicates an anomaly that is not necessarily a problem but warrants examination.

  • 60=INFO. Information about the program status.

  • 80=DEBUG. Diagnostic output that is ignorable in a well-running system.

  • 100=TRACE. Extremely detailed flow information. Only used for debugging by a programmer.

appender

The name of the appender to write output to. If this is omitted, it writes to the default appender.

Name of the appender.