WAS v8.5 > Troubleshoot > Configure Java loggingChange the message IDs used in log files
Deprecated feature: Beginning with WebSphere Application Server v6.0, logging files are formatted according to a standardized system. However, the default runtime behavior is still configured to use the older format. In new releases of WAS, the message IDs that are written to log files will be changed to ensure they do not conflict with other IBM products.
The default runtime behavior is still configured to use the older message IDs, deprecated in v8.5.
As a result of the default runtime behavior, you might see a mixture of messages that use 4–letter message prefixes and 5–letter message prefixes. The information in this topic explains how to change your configuration so the messages consistently show with 5–letter message prefixes. The default behavior has not changed to minimize the impact on customers that depend on the existence of the 4–letter message prefixes. depfeat
The following is a sample of an entry in a trace.log file using a default message ID. Note the message ID is PMON0001A
[1/26/05 10:17:12:529 EST] 0000000a PMIImpl A PMON0001A: PMI is enabled
A sample of the same entry using a new message ID follows. Note the message ID is CWPMI0001A. All new WAS message IDs begin with 'CW'.
[1/26/05 10:17:12:529 EST] 0000000a PMIImpl A CWPMI0001A: PMI is enabled.
If we are using a logging tool that uses the standardized format, you might want to change the default configuration settings to format the logging output appropriately. You will need to change the configuration for each JVM in the cell if you want the output formatting to be the same across application servers.
- To configure logging files so they use the newer, 5–letter error message prefixes for each process, use the following commands with the wsadmin utility:
- Jacl:
set cfgJvmList [$AdminConfig list JavaVirtualMachine] set cfgJvm [lindex $cfgJvmList JavaVirtualMachine] $AdminConfig create Property $cfgJvm {{name com.ibm.websphere.logging.messageId.version} {value 6} {required false}} $AdminConfig save- Using Jython:
ls = java.lang.System.getProperty("line.separator") cfgJvmList = AdminConfig.list("JavaVirtualMachine").split(ls) print cfgJvmList cfgJvm = cfgJvmList[JavaVirtualMachine] AdminConfig.create('Property', cfgJvm, [['name', 'com.ibm.websphere.logging.messageId.version'], ['value', '6'], ['required', 'false']]) AdminConfig.save()Where JavaVirtualMachine is the number of the process to use.
When we specify the process, the first process listed is zero (0), the second process is one (1), and so on. Make the changes for each JVM in the cell for consistent output formatting.
Restart the application server for the changes to take effect.
- To change the configuration so the log files contain the newer, 5–letter message prefixes in the startServer.log or stopServer.log files, modify the startServer and stopServer scripts in the install_root/bin directory.
Add the following line of code to the :WRITE_PROPERTIES_FILE section of the scripts:
>> %TMPJAVAPROPFILE% echo com.ibm.websphere.logging.messageId.version=6
Within these scripts, append the following code to the end of the existing D_ARGS parameter:
$DEBUG -Dcom.ibm.websphere.logging.messageId.version=6
Results
Message IDs written to log files will now be compliant with the new standard.
Subtopics
- Converting log files to use IBM unique Message IDs
The convertlog command creates a new log file with either new or old message IDs substituted in place of the message IDs in the source file.- convertlog command
The convertlog command is used to convert the message IDs in log entries from the old standard to the new standard, or the new standard back to the old.- MessageConverter class
The com.ibm.websphere.logging.MessageConverter class provides a method to convert a message ID at the front of a String into either a new message ID or an old message ID. The direction of the conversion is controlled with the conversionType argument.- Converting log files to use IBM unique Message IDs
The convertlog command creates a new log file with either new or old message IDs substituted in place of the message IDs in the source file.- convertlog command
The convertlog command is used to convert the message IDs in log entries from the old standard to the new standard, or the new standard back to the old.- MessageConverter class
The com.ibm.websphere.logging.MessageConverter class provides a method to convert a message ID at the front of a String into either a new message ID or an old message ID. The direction of the conversion is controlled with the conversionType argument.