Viewing Log Files and Their Messages Using Fusion Middleware Control

Managing Log Files and Diagnostic Data 12-11 ■ Message: You can select an operator, such as contains and then enter a value to be matched. ■ Add Fields: Click this to specify additional criteria, such as Host, which lets you narrow the search to particular hosts. Then click Add. For each field you add, select an operator, such as contains and then enter a value to be matched. ■ Broaden Target Scope: Click this to expand the search to logs associated with all members of the parent of the target. For example, if you are searching an applications logs, you can expand the search to contain the Managed Server to which the application is deployed. ■ Selected Targets: Expand this to see the targets that are participating in the search. To add targets, click Add and provide information in the dialog box. To remove targets, select the target and click Remove.

12.3.2.2 Searching Log Files Using WLST

You can search the log files using the WLST displayLogs command. You can narrow your search by specifying criteria, such as time, component ID, message type, or ECID. To search for error messages generated in the last 5 minutes, for the Oracle HTTP Server ohs1, use the following command: displayLogstarget=opmn:asinst_1ohs1, last=5 To search for error messages generated in the last 10 minutes for the Managed Server soa_server1, use the following command: displayLogsoracleInstance=scratchOracleMiddlewareuser_projectsdomainssoa_ domain, target=soa_server1, last=10 You can narrow your search by using the query parameter and specifying criteria, such as component ID, message type, or ECID. In the query clause, you can specify a query expression with any of the attributes listed in Table 12–1 . Some of the criteria you can use are: ■ Types of messages. For example, to search for ERROR and INCIDENT_ERROR messages for the Managed Server soa_server1, use the following command: displayLogsoracleInstance=scratchOracleMiddlewareuser_ projectsdomainssoa_domain, target=soa_server1, query=MSG_TYPE eq ERROR or MSG_TYPE eq INCIDENT_ERROR ■ A particular ECID. For example, to search for error messages with a particular ECID 0000I3K7DCnAhKB5JZ4Eyf19wAgN000001,0 for the Managed Server soa_ server1, use the following command: displayLogsoracleInstance=scratchOracleMiddlewareuser_ projectsdomainssoa_domain, target=soa_server1, query=ecid eq 0000I3K7DCnAhKB5JZ4Eyf19wAgN000001,0 ■ Component type. For example, to search for messages from Oracle HTTP Server instances, use the following query: displayLogsquery=COMPONENT_ID eq ohs 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.