Logging (logging)

Controls the capture and output of log and trace messages.

NameTypeDefaultDescription

appsWriteJson

boolean

false

When message log or console log is in JSON format, allow applications to write JSON-formatted messages to those destinations, without modification.

consoleFormat

  • DEV

  • JSON

  • SIMPLE

  • TBASIC

DEV

The required format for the console. Valid values are DEV, SIMPLE, or JSON format. By default, consoleFormat is set to the environment variable WLP_LOGGING_CONSOLE_FORMAT (if set), or DEV. 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.
DEV
Use the dev logging format.
JSON
Use the JSON logging format.
SIMPLE
Use the simple logging format.
TBASIC
Use the tbasic logging format.

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. Enable access logs by setting an accessLogging element for your httpEndpoint. 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.copy.system.streams 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.hideMessage 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.

jsonAccessLogFields

  • default

  • logFormat

default

When logs are in JSON format, use this attribute to choose between using access log fields specified in the accessLogging logFormat property or the default access log fields.
default
Use the default set of access log fields.
logFormat
Use the set of access log fields that match logFormat.

jsonFieldMappings

string

When logs are in JSON format, use this attribute to replace default field names with new field names or to omit fields from the logs. To replace a field name, configure the new field name by using the following format: defaultFieldName:newFieldName?. For field names that are associated with logs of a specified source, use the following format: [source:]?defaultFieldName:newFieldName?, where [source] is the source you want to specify, such as message, trace, or accessLog. To omit a field from the logs, specify the field name without a replacement, as shown in the following example: defaultFieldName:. To rename or omit multiple fields, specify a comma-separated list of field name mappings.

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

  • JSON

  • SIMPLE

  • TBASIC

SIMPLE

The required format for the messages.log file. Valid values are SIMPLE or JSON format. By default, messageFormat is set to the environment variable WLP_LOGGING_MESSAGE_FORMAT (if set), or SIMPLE. 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.
JSON
Use the JSON logging format.
SIMPLE
Use the simple logging format.
TBASIC
Use the tbasic logging format.

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. Enable access logs by setting an accessLogging element for your httpEndpoint. 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

When this attribute is set to true, it prevents potentially sensitive information from being exposed in log and trace files. The default value is false. Avoid trouble: Use the com.ibm.ws.logging.suppress.sensitive.trace 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

  • TBASIC

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.
TBASIC
Alias for the 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.

binaryLog

Binary logging options. The binary log can be viewed using the logViewer command.

NameTypeDefaultDescription

bufferingEnabled

boolean

true

Specifies whether to allow a small delay in saving records to the disk for improved performance. When bufferingEnabled is set to true, records will be briefly held in memory before being written to disk.

fileSwitchTime

int
Min: 0
Max: 23

Makes the server close the active log file and start a new one at the specified hour of the day. When the value for fileSwitchTime is specified, file switching is enabled, otherwise it is disabled.

outOfSpaceAction

  • PurgeOld

  • StopLogging

  • StopServer

StopLogging

Specifies the action to perform when the file system where records are kept runs out of free space. When outOfSpaceAction is set to "StopLogging" the server will stop logging when records are not able to be written to disk. When this attribute is set to "PurgeOld" the server will attempt to delete the oldest records from the binary log repository to make space for new records. When this attribute is set to "StopServer" the binary log will stop the server when records cannot be written.
PurgeOld
Remove old records

purgeMaxSize

int
Min: 0

50

Specifies the maximum size for the binary log repository in megabytes. When the value for purgeMaxSize is specified with a value of more than 0, cleanup based on repository size is enabled, otherwise it is disabled; a value of 0 means no limit.

purgeMinTime

A period of time with hour precision

0

Specifies the duration, in hours, after which a server can remove a log record. When the value for purgeMinTime is specified with a value of more than 0, cleanup based on log record age is enabled, otherwise it is disabled; a value of 0 means no limit. Specify a positive integer followed by the unit of time, which can be hours (h). For example, specify 12 hours as 12h.

binaryTrace

Binary trace options. The binary trace can be viewed using the logViewer command.

NameTypeDefaultDescription

bufferingEnabled

boolean

true

Specifies whether to allow a small delay in saving records to the disk for improved performance. When bufferingEnabled is set to true, records will be briefly held in memory before being written to disk.

fileSwitchTime

int
Min: 0
Max: 23

Makes the server close the active trace file and start a new one at the specified hour of the day. When the value for fileSwitchTime is specified, file switching is enabled, otherwise it is disabled.

outOfSpaceAction

  • PurgeOld

  • StopLogging

  • StopServer

StopLogging

Specifies the action to perform when the file system where records are kept runs out of free space. When outOfSpaceAction is set to "StopLogging" the server will stop tracing when records are not able to be written to disk. When this attribute is set to "PurgeOld" the server will attempt to delete the oldest records from the binary trace repository to make space for new records. When this attribute is set to "StopServer" binary trace will stop the server when records cannot be written.
PurgeOld
Remove old records

purgeMaxSize

int
Min: 0

50

Specifies the maximum size for the binary trace repository in megabytes. When the value for purgeMaxSize is specified with a value of more than 0, cleanup based on repository size is enabled, otherwise it is disabled; a value of 0 means no limit.

purgeMinTime

A period of time with hour precision

0

Specifies the duration, in hours, after which a server can remove a trace record. When the value for purgeMinTime is specified with a value of more than 0, cleanup based on trace record age is enabled, otherwise it is disabled; a value of 0 means no limit. Specify a positive integer followed by the unit of time, which can be hours (h). For example, specify 12 hours as 12h.