Viewing Log Files and Their Messages Using WLST

12-12 Oracle Fusion Middleware Administrators Guide ■ Range of time. To search for error messages that occurred within a specified range of time, you specify the attribute TSTZ_ORIGINATING with both from and to operators, using the following format: displayLogsquery=TSTZ_ORIGINATING from start_time and TSTZ_ORIGINATING to end_time You specify the date using the following ISO 8601 time format: 2010-09-30T12:00:00:0000-08:00 For example, to display the error message from between 8:00 a.m. and 11 a.m. on April 17, 2010, use the following command: displayLogsquery=TSTZ_ORIGINATING from 2010-04-17T08:00:00-07:00 and TSTZ_ORIGINATING to 2010-04-17T11:00:00-07:00 To display a count of messages, grouped by specific attributes, use the groupBy parameter to the WLST command displayLogs. For example, to display the count of WARNING messages by component, use the following command: displayLogsgroupBy=[COMPONENT_ID], query=MSG_TYPE eq WARNING

12.3.3 Downloading Log Files

You can download messages using Fusion Middleware Control or WLST commands, as described in the following topics: ■ Downloading Log Files Using Fusion Middleware Control ■ Downloading Log Files Using WLST

12.3.3.1 Downloading Log Files Using Fusion Middleware Control

You can download the log messages to a file. You can download either the matching messages from a search or the messages in a particular log file. To download the matching messages from a search to a file using Fusion Middleware Control: 1. From the navigation pane, select the target, such as the domain. 2. From the dynamic target menu, choose Logs, then View Log Messages. The Log Messages page is displayed. 3. Search for particular types of messages as described in Section 12.3.2.1 . 4. Select a file type by clicking Export Messages to File and select one of the following: ■ As Oracle Diagnostic Log Text .txt ■ As Oracle Diagnostic Log Text .xml ■ As Comma-Separated List .csv An Opening dialog box is displayed. 5. Select either Open With or Save to Disk. Click OK. To export specific types of messages or messages with a particular Message ID to a file: 1. From the navigation pane, expand the farm, then WebLogic Domain, and then the domain. Select a Managed Server. Managing Log Files and Diagnostic Data 12-13 2. From the dynamic target menu, choose Logs, then View Log Messages. The Log Messages page is displayed. 3. Search for particular types of messages as described in Section 12.3.2.1 . 4. For Show, select Group by Message Type or Group by Message ID. 5. To download the messages into a file, if you selected Group by Message Type, select the link in one of the columns that lists the number of messages, such as the Errors column. If you selected Group by Message ID, select one of the links in the Occurrences column. The Messages by Message Type page or Message by Message ID is displayed. 6. Select a file type by clicking the arrow near Export All to File. You can select one of the following: ■ As Oracle Diagnostic Log Text .txt ■ As Oracle Diagnostic Log Text .xml ■ As Comma-Separated List .csv An Opening dialog box is displayed. 7. Select either Open With or Save to Disk. Click OK. To download the log files for a specific component using Fusion Middleware Control: 1. From the navigation pane, expand the farm. For system components, expand the installation type, such as Web Tier and select the component. For Java components, expand the farm, then the component type, and then select the component. 2. From the dynamic target menu, choose Logs, then View Log Messages. The Log Messages page is displayed. 3. Click Target Log Files. The Log Files page is displayed. On this page, you can see a list of log files related to the component or application. 4. Select a log file and click Download. 5. An Opening dialog box is displayed. 6. Select either Open With or Save to Disk. Click OK.

12.3.3.2 Downloading Log Files Using WLST

You can download log files using the WLST displayLogs command and redirecting the output to a file. For example: displayLogstype=[ERROR,INCIDENT_ERROR], export=download_log.txt The messages are written to the file download_log.txt.

12.4 Configuring Settings for Log Files

You can change the log settings of Managed Servers and Java components using Fusion Middleware Control or WLST. 12-14 Oracle Fusion Middleware Administrators Guide For Java components, you can configure the names and locations of log files, the size of the log files, the level of information written to the log files, the format, and the Locale encoding, as described in the following topics: ■ Changing Log File Locations ■ Configuring Log File Rotation ■ Setting the Level of Information Written to Log Files ■ Specifying the Log File Format ■ Specifying the Log File Locale Note the following about using the WLST commands to configure log settings: ■ To use the custom WLST logging commands, you must invoke the WLST script from the Oracle Common home. See Section 3.5.1.1 for more information. ■ The configuration commands, such as setLogLevel, only work in connected mode. That is, you must connect to a running WebLogic Server instance before you invoke the commands. The configuration commands are supported for Java components that run within a WebLogic Server, but are not supported for Oracle WebLogic Server. The configuration commands are not supported for system components. ■ Most of the WLST logging commands require that you are running in the domainRuntime tree. For example, to connect and to run in the domainRuntime tree, use the following commands: .wlst.sh connectusername, password, localhost:port_number domainRuntime ■ The listLoggers, getLogLevel, and setLogLevel commands work in config and runtime mode. In config mode the commands work on loggers that are defined in the configuration file. In runtime mode, the commands work directly with loggers that are defined in the server JVM. By default, the setLogLevel command sets the level on the run-time logger and updates the logger definition in the configuration file. By default, the listLoggers and getLogLevel commands return run-time loggers.

12.4.1 Changing Log File Locations

You can change the name and location of log files by using Fusion Middleware Control or WLST commands, as described in the following topics: ■ Changing Log File Locations Using Fusion Middleware Control ■ Changing Log File Locations Using WLST Note: You cannot configure options for log files of system components, which are listed in Section 3.5.2 , using Fusion Middleware Control. For information about how to configure options for log files for system components, see the Administrators Guide for the component. See Also: Logging Custom WLST Commands in the Oracle Fusion Middleware WebLogic Scripting Tool Command Reference