Logging (logging)

Controls the capture and output of log and trace messages.

NameTypeDefaultDescription

consoleFormat

string

basic

The required format for the console. Valid values are basic or JSON format. By default, consoleFormat is set to the environment variable WLP_LOGGING_CONSOLE_FORMAT (if set), or basic. Avoid trouble: Use the WLP_LOGGING_CONSOLE_FORMAT environment variable or the com.ibm.ws.logging.console.format property, except in cases where you are trying to change the configuration dynamically after startup.

consoleLogLevel

  • AUDIT

  • ERROR

  • INFO

  • OFF

  • WARNING

AUDIT

The logging level used to filter messages written to system streams. The valid values are INFO, AUDIT, WARNING, ERROR, and OFF. By default, the consoleLogLevel is set to the WLP_LOGGING_CONSOLE_LOGLEVEL environment variable (if set), or AUDIT. Note: Before you change this value, consider the information in the section "Unable to interact with the Liberty server after modifying the console log level settings" in the topic Developer Tools known restrictions. Avoid trouble: Use the WLP_LOGGING_CONSOLE_LOGLEVEL environment variable or the com.ibm.ws.logging.console.level property, except in cases where you are trying to change the configuration dynamically after startup.
AUDIT
Audit and warning messages will be written to the system output stream. Error messages will be written to the system error stream.
ERROR
Error messages will be written to the system error stream.
INFO
Info, audit, and warning messages will be written to the system output stream. Error messages will be written to the system error stream.
OFF
No server output is written to system streams. Only JVM output is written to system streams.
WARNING
Warning messages will be written to the system output stream. Error messages will be written to the system error stream.

consoleSource

string

message

The list of comma-separated sources that route to the console/console.log. This property applies only when consoleFormat=json. Valid values are message, trace, accessLog, ffdc, and audit. By default, consoleSource is set to the environment variable WLP_LOGGING_CONSOLE_SOURCE (if set), or message. Note: To use the audit source, enable the Liberty audit feature. Avoid trouble: Use the WLP_LOGGING_CONSOLE_SOURCE environment variable or the com.ibm.ws.logging.console.source property, except in cases where you are trying to change the configuration dynamically after startup.

copySystemStreams

boolean

true

If true, messages that are written to the System.out and System.err streams are copied to console.log. If false, those messages are written to configured logs such as messages.log or trace.log, but they are not copied to console.log. The default value is true. Avoid trouble: Use the com.ibm.ws.logging.console.copySystemStreams property, except in cases where you are trying to change the configuration dynamically after startup.

hideMessage

string

The list of messages, which are separated by a comma, that are configured to be hidden from the console.log and messages.log files. If the messages are configured to be hidden, then they are redirected to the trace.log file. Avoid trouble: Use the com.ibm.ws.logging.hide.messages property, except in cases where you are trying to change the configuration dynamically after startup.

isoDateFormat

boolean

false

The date and time use a locale-specific format or the ISO-8601 format. You can specify true or false for the value of the attribute or the value of the equivalent property. The default value is false. Avoid trouble: Use the com.ibm.ws.logging.isoDateFormat property, except in cases where you are trying to change the configuration dynamically after startup. If you specify a value of true, the ISO-8601 format is used in the messages.log file, the trace.log file, and the FFDC logs. The format is yyyy-MM-dd'T'HH:mm:ss.SSSZ. If you specify a value of false, the date and time are formatted according to the default locale set in the system. If the default locale is not found, the format is dd/MMM/yyyy HH:mm:ss:SSS z.

logDirectory

Path to a directory

${server.output.dir}/logs

You can use this attribute to set a directory for all log files, excluding the console.log file, but including FFDC. By default, logDirectory is set to the LOG_DIR environment variable. The default LOG_DIR environment variable path is WLP_OUTPUT_DIR/serverName/logs. Avoid trouble: Use the LOG_DIR environment variable or the com.ibm.ws.logging.log.directory property, except in cases where you are trying to change the configuration dynamically after startup.

maxFileSize

int
Min: 0

20

The maximum size (in MB) that a log file can reach before it is rolled. The Liberty runtime does only size-based log rolling. To disable this attribute, set the value to 0. The maximum file size is approximate. By default, the value is 20. Note: maxFileSize does not apply to the console.log file.

maxFiles

int
Min: 0

2

Maximum number of log files that are kept before the oldest file is removed; a value of 0 means no limit. If an enforced maximum file size exists, this setting is used to determine how many of each of the log files are kept. This setting also applies to the number of exception logs that summarize exceptions that occurred on a particular day. So if this number is 10, you might have 10 message logs, 10 trace logs, and 10 exception summaries in the ffdc/directory. By default, the value is 2. Note: maxFiles does not apply to the console.log file.

messageFileName

string

messages.log

Name of the file to which message output is written relative to the configured log directory. The default value is messages.log. This file always exists and contains INFO and other (AUDIT, WARNING, ERROR, FAILURE) messages, in addition to System.out and System.err. This log also contains time stamps and the issuing thread ID. If the log file is rolled over, the names of earlier log files have the format messages_timestamp.log. Avoid trouble: Use the com.ibm.ws.logging.message.file.name property, except in cases where you are trying to change the configuration dynamically after startup.

messageFormat

string

basic

The required format for the messages.log file. Valid values are basic or JSON format. By default, messageFormat is set to the environment variable WLP_LOGGING_MESSAGE_FORMAT (if set), or basic. Avoid trouble: Use the WLP_LOGGING_MESSAGE_FORMAT environment variable or the com.ibm.ws.logging.message.format property, except in cases where you are trying to change the configuration dynamically after startup.

messageSource

string

message

The list of comma-separated sources that route to the messages.log file. This property applies only when messageFormat=json. Valid values are message, trace, accessLog, ffdc, and audit. By default, messageSource is set to the environment variable WLP_LOGGING_MESSAGE_SOURCE (if set), or message. Note: To use the audit source, enable the Liberty audit feature. Avoid trouble: Use the WLP_LOGGING_MESSAGE_SOURCE environment variable or the com.ibm.ws.logging.message.source property, except in cases where you are trying to change the configuration dynamically after startup.

suppressSensitiveTrace

boolean

false

The server trace can expose sensitive data when tracing untyped data, such as bytes received over a network connection. If true, prevent potentially sensitive information from being exposed in log and trace files. The default value is false. Avoid trouble: Use the com.ibm.ws.logging.filter.sensitive property, except in cases where you are trying to change the configuration dynamically after startup.

traceFileName

string

trace.log

Name of the file to which trace output is written relative to the configured log directory. The default value is trace.log. The trace.log file is only created if a traceSpecification is set including log levels below INFO. stdout is recognized as a special value and causes trace to be directed to the original standard out stream. Avoid trouble: Use the com.ibm.ws.logging.trace.file.name property, except in cases where you are trying to change the configuration dynamically after startup.

traceFormat

  • ADVANCED

  • BASIC

  • ENHANCED

ENHANCED

This format is used for the trace log. Avoid trouble: Use the com.ibm.ws.logging.trace.format property, except in cases where you are trying to change the configuration dynamically after startup.
ADVANCED
Use the advanced trace format.
BASIC
Use the basic trace format.
ENHANCED
Use the enhanced basic trace format.

traceSpecification

string

*=info

A trace specification that conforms to the trace specification grammar and specifies the initial state for various trace components. The trace specification is used to selectively enable trace. An empty value is allowed and treated as 'disable all trace'. Any component that is not specified is initialized to a default state of *=info.