Logging (logging)
Controls the capture and output of log and trace messages.
Name | Type | Default | Description |
---|---|---|---|
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 | 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. |
consoleLogLevel |
| 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. |
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 | 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. |
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. |
maxFfdcAge | A period of time with minute precision | -1 | The maximum wanted age before an FFDC file is deleted. Specify a positive integer followed by a unit of time, which can be days (d), hours (h), or minutes (m). For example, specify 2 days as 2d. You can include multiple values in a single entry. For example, 2d6h is equivalent to 2 days and 6 hours. Everyday at midnight, any FFDC file that reaches the maximum age is deleted. By default, FFDC files are not deleted based on file age. Specify a positive integer followed by a unit of time, which can be hours (h) or minutes (m). For example, specify 30 minutes as 30m. You can include multiple values in a single entry. For example, 1h30m is equivalent to 90 minutes. |
maxFileSize | int | 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 | 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 |
| 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. |
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. |
rolloverInterval | A period of time with minute precision | -1 | The time interval in between log rollovers, in minutes if a unit of time is not specified. Specify a positive integer followed by a unit of time, which can be days (d), hours (h), or minutes (m). For example, specify 5 hours as 5h. You can include multiple values in a single entry. For example, 1d5h is equivalent to 1 day and 5 hours. If rolloverStartTime is specified, the default value of rolloverInterval is 1 day. If both rolloverInterval and rolloverStartTime are unspecified, time based log rollover is disabled. Note: rolloverInterval does not apply to the console.log file. Specify a positive integer followed by a unit of time, which can be hours (h) or minutes (m). For example, specify 30 minutes as 30m. You can include multiple values in a single entry. For example, 1h30m is equivalent to 90 minutes. |
rolloverStartTime | string | The scheduled time of day for logs to first roll over. The rollover interval duration begins at rollover start time. Valid values follow a 24-hour ISO-8601 datetime format of HH:MM, where 00:00 represents midnight. Padding zeros are required. If rolloverInterval is specified, the default value of rolloverStartTime is 00:00, midnight. If both rolloverInterval and rolloverStartTime are unspecified, time based log rollover is disabled. Note: rolloverStartTime does not apply to the console.log file. | |
stackTraceSingleEntry | boolean | false | Handle stack traces written to System.out/System.err as a single event in the logs. |
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 |
| 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. |
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.
Name | Type | Default | Description |
---|---|---|---|
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 | 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 |
| 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. |
purgeMaxSize | int | 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.
Name | Type | Default | Description |
---|---|---|---|
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 | 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 |
| 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. |
purgeMaxSize | int | 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. |