Managing Log Files
Many Enterprise Manager components generate log files containing messages that record errors, notifications, warnings, and traces.
Table 8-1 describes the columns in the Log Message table. For any given component, the optional column may not be populated in the message.
Table 8-1 Message Columns
Column Name | Description |
---|---|
Time |
The date and time when the message was generated. This reflects the local time zone. |
Message Type |
The type of message. Possible values are: Incident Error Warning, Notification, and Trace. In addition, the value Unknown may be used when the type is not known. |
Message ID |
The ID that uniquely identifies the message within the component. The ID consists of a prefix that represents the component, followed by a dash, then a 5-digit number. For example: OHS-51009 |
Message |
The text of the error message. |
Target (Expanded) |
Expanded target name. |
Target |
Target name |
Target Type |
Target type |
Execution Context |
The Execution Context ID (ECID), which is a global unique identifier of the execution of a particular request in which the originating component participates. You can use the ECID to correlate error messages from different components. The Relationship ID, which 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. |
Component |
The component that originated the message. |
Module |
The identifier of the module that originated the message. |
Incident ID |
The identifier of the incident to which this message corresponds. |
Instance |
The name of the Oracle instance to which the component that originated the message belongs. |
Message Group |
The name of the group to which this message belongs. |
Message Level |
The message level, represented by an integer value that qualifies the message type. Possible values are from 1 (highest severity) through 32 (lowest severity). |
Hosting Client |
The identifier for the client or security group to which this message relates. |
Organization |
The organization ID for the originating component. The ID is |
Host |
The name of the host where the message originated. |
Host IP Address |
The network address of the host where the message originated. |
User |
The name of the user whose execution context generated the message. |
Process ID |
The ID for the process or execution unit that generated the message. |
Thread ID |
The ID of the thread that generated the message. |
Upstream Component |
The component that the originating component is working with on the client (upstream) side. |
Downstream Component |
The component that the originating component is working with on the server (downstream) side. |
Detail Location |
A URL linking to additional information regarding the message. |
Supplemental Detail |
Supplemental information about the event, including more detailed information than the message text. |
Archive |
Values are Yes or No. If the checkbox is checked, the message is collected from the archive location. Otherwise, the message is collected from the live system. |
Target Log Files |
Link to the log files page for this target. |
Log File |
Log file that this message contains. |
Using Log Viewer, you can do the following:
Viewing Log Files and Their Messages
You can use Enterprise Manager to view messages across log files.
In particular, when you navigate in the context of a farm or domain, then the logs that you can view and search are filtered to just those associated with that farm or domain. When you navigate to Logs by way of the Enterprise menu, you can pick and choose exactly what targets you want to view and search logs against. You could also, for example pick multiple WebLogic Server targets that span across domains/farm.
For example, to view the log files and their messages:
When trying to view log messages, you may see the following error:
Logging Configuration is missing or invalid for the targets (). Also, make sure that these targets are up and EM User has the CONFIGURE_TARGET privilege on the corresponding domains.
To ascertain which method to use to fix the problem, choose one of these three alternatives:
-
The domain's Administration Server is down. To resolve the problem, start the Administration Server and try viewing log messages again.
-
The Managed Server for which you are trying to view log messages is down. To resolve the problem, start the Managed Server and try viewing log messages again.
-
The Enterprise Manager administrator who is trying to access log messages does not have the necessary target privileges to do so. In order to view log messages, the administrator must have been granted the target privilege “Configure target" for the corresponding WebLogic Domain target. Talk to your Oracle Enterprise Manager site administrator or super administrator regarding whether or not you have this privilege.
Restricting Access to the View Log Messages Menu Item and Functionality
You can restrict which administrators in Oracle Enterprise Manager have access to the View Log Messages menu item and its corresponding functionality. You can grant a target privilege labeled “Ability to view Fusion Middleware Logs" to administrators and/or roles. This target privilege is applicable to all Oracle Fusion Applications related and Oracle Fusion Middleware related target types. This target privilege is automatically included as part of the following other target privileges: Operator Fusion Middleware, Operator, and Full. Consequently, you can grant an administrator one of the following privileges in order for him/her to be able to view log messages for Oracle Fusion Applications related and Oracle Fusion Middleware related log files:
-
Ability to view Fusion Middleware Logs target privilege
-
Operator Fusion Middleware target privilege
-
Operator target privilege
-
Full target privilege
To grant the ability to an administrator to view the Fusion Middleware Logs target privilege, follow these steps:
- Log in to the Enterprise Manager console as a super administrator.
- From the Setup menu, choose Security, then Administrators.
- Select the appropriate administrator and click Edit.
- Click Next twice to arrive on the Target Privileges page of the wizard.
- Scroll down the page and click Add in the Target Privileges section of the page.
- From the Search and Add: Targets popup dialog, select the appropriate targets for which the administrator should have access to view logs. Click Select.
- From the Target Privileges section of the Target Privileges page of the wizard, select the targets to which you want to grant the “Ability to view Fusion Middleware Logs" target privilege and select Grant to Selected. Notice that the default target privilege automatically given for this target is View.
- Select the Ability to view Fusion Middleware Logs target privilege and click Continue. Notice that the “Ability to view Fusion Middleware Logs" target privilege is also included as part of other target privileges (for example, Operator target privilege). So, depending on the responsibilities of the administrator, you may want to grant the Operator target privilege to the administrator.
- Notice on the Target Privileges page of the wizard the appearance of the new privilege. Click Review and then Finish to conclude the operation.
Registering Additional Log Files
You may find that you want to add custom log files for WebLogic Server such that those log files and messages appear in the Enterprise Manager Log Viewer. While Enterprise Manager does not support adding custom log files via the Log Viewer user interface, there is a way to do it outside of Enterprise Manager.
Normally the ODL LogQueryMBean automatically discovers the Weblogic server logs and any ODL log file defined in the logging.xml file associated with the Weblogic server. However, you can register additional log files with the ODL LogQueryMBean, so that these files can be viewed and/or downloaded from the Enterprise Manager Log Viewer.
When registering a new log file there are two options you can use:
-
You can register a log file with an associated LogReader that can be used to parse the contents of the file. In this case the contents of the file can be viewed and searched from the main Log Messages page.
-
You can register the path to the log file, but do not provide a LogReader to parse the contents of the file. In this case the contents of the file cannot be viewed and searched from the main Log Messages page, but you can view the raw contents of the file or download its contents from the Target Log Files page.
To register one or more additional log files you can create a file under directory:
DOMAIN_HOME/config/fmwconfig/servers/SERVER_NAME/diagnostics-registration
The file must have a .xml suffix and it should have contents similar to the following:
<?xml version='1.0' encoding='UTF-8'?> <logs xmlns='http://www.oracle.com/iAS/EMComponent/ojdl'> <log path="/home/oracle/mylogs/my-odl-diagnostic.log"> <logreader class="oracle.core.ojdl.reader.ODLLogReaderFactory"> </logreader> </log> </logs>
In this case the file is an ODL file and it is being registered with a LogReader. In addition to the ODL LogReader, there are a few existing log readers that can be used to read other formats.
You can also register a log without a log reader as seen here:
<?xml version='1.0' encoding='UTF-8'?> <logs xmlns='http://www.oracle.com/iAS/EMComponent/ojdl'> <log path="/home/oracle/mylogs/my-other-diagnostic.log"/> </logs>
You may use variables or a wildcard in the log path. The wildcard is denoted by "%*%", while a variable has the form of "%NAME%". Multiple occurrences of the same variable in the path must have the exact same value. If a variable appears only once, it will behave like a wildcard.
All log files registered in this way are associated with the server target in Enterprise Manager.
Searching Log Files
You can search for diagnostic messages using the Log Messages page. By default, this page shows a summary of the logged issues for the last 10 minutes.
You can modify the search criteria to identify messages of relevance. You can view the search results in different modes, allowing ease of navigation through large amounts of data.
The following sections describe how to search log files:
Searching Log Files: Basic Searches
You can search for all of the messages for all of the entities in a domain, an Oracle WebLogic Server, a component, or an application.
For example, to search for messages for a domain:
Searching Log Files: Advanced Searches
You can refine your search criteria using the following controls in the Log Messages page:
-
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.
-
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.
-
Search Archived Logs: Enable this check box to access the log viewer. These are the archive log file locations for multiple targets you configured on the Configure Archive Locations page.
Note:
The Search Archived Logs check box is not applicable to standalone Oracle HTTP Servers.
Downloading Log Files
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:
-
From the Enterprise menu, select Monitoring, then select Logs.
or
From the Targets menu, select Middleware, then select a domain. From the Farm menu, select Logs, then select View Log Messages.
The Log Messages page is displayed.
-
Search for particular types of messages as described in Searching Log Files: Basic Searches.
-
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 XML (.xml)
-
As Comma-Separated List (.csv)
An Opening dialog box is displayed.
-
-
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:
-
From the Enterprise menu, select Monitoring, then select Logs.
or
From the Targets menu, select Middleware, then select a domain. From the Farm menu, select Logs, then select View Log Messages.
The Log Messages page is displayed.
-
Search for particular types of messages as described in Searching Log Files: Basic Searches.
-
For Show, select Group by Message Type or Group by Message ID.
-
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.
-
Select a file type by clicking the arrow near Export Messages to File.
You can select one of the following:
-
As Oracle Diagnostic Log Text (.txt)
-
As Oracle Diagnostic Log XML (.xml)
-
As Comma-Separated List (.csv)
An Opening dialog box is displayed.
-
-
Select either Open With or Save to Disk. Click OK.
To download the log files for a specific component: