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 Error Reporting.
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, WebSphere and WebLogic
In the
...\<AWI>\config
folder of your application server -
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 Start AWI.
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 logback.xml - Configuring 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.
<!-- 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
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
- Open the
logback.xml
file. - Search for the
<root>
element.Tip: You can find the
<root>
element by searching forref="LOGGER"
. The<root>
element is one line above. - 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. - For the changes to take effect, stop and restart your application server.
Example
The log level is set to "DEBUG" (default value) 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:
Configuring the Automic Web Interface, particularly the Configuring the Logging section and sub sections