logback.xml - Configuring Log Levels

The specifications for AWI logging are defined in the logback.xml configuration file. Use this file to configure the lowest severity level of messages that you want to have tracked. You can change this value, but you should not change anything else in the file. This topic briefly describes the logback.xml configuration file and how to change the default setting for the severity level of AWI event messages that are logged.

For information about the logging and tracing options in AWI, and how to collect log data to report an error, see Preparing Log Files for Reporting Errors.

In AAKE you have additional options to change the default log level. For more information see Configuring Container-Based Systems.

This page includes the following:

Configuration required?

No. Default values are provided in the delivered version.

File Location

You find the AWI log files in the following location:

  • Installations with Tomcat

    In the ...\<application server>\logs folder

  • Installations with the bundled Jetty launcher

    AWI stores the log files in the /osgi-tmp folder. Each running instance creates a subfolder with an ascending number, starting at 0. The folders contain both the osgi-related data and the AWI log files.

    Exception: If you start AWI using the command line and you add the -console parameter to the command, the log is written to the console instead.

    For more information about starting AWI using the command line, see:

logback.xml Structure

This list explains the root element where you set the log level for the LOGGER appender in logback.xml. The rest of the file is not described, because you should not modify it.

  • <root level="log_level">

    The start of the root element and the specification of the "level" attribute, where you define the log level. For more information, see Log Levels.

  • <appender-ref ref="LOGGER" />

    Identifies that this is the <root> element for the LOGGER appender. The LOGGER appender is the component that writes the logging events for AWI actions and events.

  • </root>

    End of the root element

Example:

The following piece of code is the section of the logback.xml where you set the root log level for logging in AWI. Here it is set to "INFO", which is the default value and appropriate for a production environment. You can change this, for example to "DEBUG" when you need more verbose log files with more details for error analysis. It is recommended that you use DEBUG on testing and development instances only.

<!-- Log level is set here. Possible values: TRACE, DEBUG, INFO, WARN, ERROR

          DEBUG is recommended on testing and development instances.

          INFO is recommended on production instances.

-->

The following piece of code avoids too many log entries.

          <appender-ref ref="LOGGER" />

</root>

Changing the Log Level

You have two options to change the log level:

  • Through the user interface, see AWI Management: Logging

    Important! If you change the log level through the user interface, this change will be lost as soon as you restart the application server.

  • Modifying the logback.xml file

Changing the Log Level in the logback.xml File

The log level is defined in the <root> element by the level="[log_level]"> element The <root> element contains the <appender-ref> element that specifies that this <root> element defines the LOGGER appender. The LOGGER appender is the component that writes the logging events to the log file.

For information about the available log levels, see Log Levels at Configuring AWI.

Important! Do not change any other parameters in this file. Changing other parameters might prevent CA Automic from investigating situations that cause errors.

To Change the Log Level

  1. Open the logback.xml file.
  2. Search for the <root> element.

    Tip: You can find the <root> element by searching for ref="LOGGER". The <root> element is one line above.

  3. Change the log level for the root appender by setting the level="[log_level]" attribute to the lowest log level for which you want messages to be written to the log file.
  4. For the changes to take effect, stop and restart your application server.

Example

The log level is set to "DEBUG" in the following example. If you change it to "INFO", fewer messages are written to the file, as non-critical log messages are ignored.

<!-- Log level is set here. Possible values: TRACE, DEBUG, INFO, WARN, ERROR

          DEBUG is recommended on testing and development instances.

          INFO is recommended on production instances.

-->

<root level="DEBUG">

          <appender-ref ref="LOGGER" />

</root>

See also: