Specifying Log File Rotation Using Fusion Middleware Control

Managing Log Files and Diagnostic Data 12-21 ■ Specifying the Log File Format Using WLST

12.4.4.1 Specifying the Log File Format Using Fusion Middleware Control

To change the format using Fusion Middleware Control: 1. From the navigation pane, select the component. 2. From the dynamic target menu, choose Logs, then Log Configuration. The Log Configuration page is displayed. 3. Select the Log Files tab. 4. In the table, select the log file and click Edit Configuration. The Edit Log File dialog box is displayed. 5. For Log File Format, select Oracle Diagnostics Logging - Text or Oracle Diagnostics Logging - XML. 6. Click OK. 7. In the confirmation window, click Close.

12.4.4.2 Specifying the Log File Format Using WLST

To specify the log file format using WLST, you use the configureLogHandler command, with the format parameter and specify either ODL-Text or ODL-XML. ODL-Text is the default. For example, to specify ODL-XML format, use the following command: configureLogHandlername=odl-handler, format=ODL-XML

12.4.5 Specifying the Log File Locale

The language and data formats used in the log files are determined by the default locale of the server Java Virtual Machine JVM. You can change them using the Language and Regional Options applet in Control Panel on Windows or the LANG and LC_ALL environment variables on a UNIX platform. The character encoding of log files is determined by the server JVMs default character encoding or an optional configuration setting. You should choose an encoding that supports all languages used by the users, or the log file may be corrupted. By default, the log is in the server JVMs default character encoding. If you change the encoding, delete or rename old log files to prevent them from being damaged by the new logs appended in a different encoding. For support of any language, Oracle recommends that you use Unicode UTF-8 encoding. On a UNIX operating system, setting the LANG and LC_All environment variables to a locale with the UTF-8 character set enables UTF-8 logging for example, en_US.UTF-8 for the US locale in UTF-8 encoding. You can specify the log file locale using WLST commands or by editing a file, as described in the following topics: ■ Specifying the Log File Encoding Using WLST ■ Specifying the Log File Encoding in logging.xml

12.4.5.1 Specifying the Log File Encoding Using WLST

To specify the log file encoding using WLST, use the configureLogHandler command. You can use the encoding parameter to specify the character set encoding. 12-22 Oracle Fusion Middleware Administrators Guide For example, to specify UTF-8, use the following command: configureLogHandlername=odl-handler, encoding=UTF-8

12.4.5.2 Specifying the Log File Encoding in logging.xml

To specify the log file encoding in the logging.xml file, use an optional encoding property to specify the character set encoding. The logging.xml file is located in the following directory: DOMAIN_HOMEconfigfmwconfigserversserver_name For example, to specify UTF-8, add the following encoding property in the log_ handler element: property name=encoding value=UTF-8

12.5 Correlating Messages Across Log Files and Components

Oracle Fusion Middleware components provide message correlation information for diagnostic messages. Message correlation information helps those viewing diagnostic messages to determine relationships between messages across components. Each diagnostic message contains an Execution Context ID ECID and a Relationship ID RID : ■ An ECID is a globally unique identifier associated with the execution of a particular request. An ECID is generated when the request is first processed. ■ A RID distinguishes the work done in one thread on one process, from work done by any other threads on this and other processes on behalf of the same request. The ECID and RID help you to use log file entries to correlate messages from one application or across Oracle Fusion Middleware components. By searching for related messages using the message correlation information, multiple messages can be examined and the component that first generates a problem can be identified this technique is called first-fault component isolation. Message correlation data can help establish a clear path for a diagnostic message across components, within which errors and related behavior can be understood. You can use the ECID and RID to track requests as they move through Oracle Fusion Middleware. The following shows an example of an ECID: 0000I3K7DCnAhKB5JZ4Eyf19wAgN000001,0 The RID is one or more numbers separated by a colon :. The first RID created for a request is 0. Each time work is passed from a thread that has an ECID associated with it to another thread or process, a new RID is generated that encodes the relationship to its creator. That is, a new generation is created. Each shift in generation is represented by a colon and another number. For example, the seventh child of the third child of the creator of the request is: 0:3:7 You can view all the messages with the same ECID using the WLST displayLogs command. The following example searches for the ECID in the domain: displayLogsecid=0000Hl9TwKUCslT6uBi8UH18lkWX000002