28.1 Managing Log Files

Many Enterprise Manager components generate log files containing messages that record errors, notifications, warnings, and traces.

Table 28-1 describes the columns in the Log Message table. For any given component, the optional column may not be populated in the message.

Table 28-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 oracle for all Oracle components.

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.

28.1.1 Viewing Log Files and Their Messages

You can use Enterprise Manager Cloud Control 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:

  1. From the Enterprise menu, select Monitoring, select Logs, then select the target from the popup target selector.

    or

    The Logs menu is available at the individual target label and at the parent target level. For example, for WebLogic server and for other j2ee components, the logs menu can be accessed by choosing Logs from the Targets menu. The same is applicable for parent targets like domain and farm targets.

  2. In the context of a farm or domain, expand Selected Targets and in the row for a particular component or application, click the Target Log Files icon.

    When you are in the context of the Enterprise menu, add targets to the Target table and click the Target Log Files icon.

    The Log Files page is displayed. On this page, you can see a list of log files related to the target.

  3. Select a file and click View Log File.

    The View Log File page is displayed. On this page, you can view the list of messages and download the log file from this page.

  4. To view the details of a message, select the message.

    By default, the messages are sorted by time, in ascending order. You can sort the messages by the any of the columns, such as Message Type, by clicking the column name. The Message Type is sorted by importance from highest to lowest and uses the order of Incident Error, Error, Warning, Notification, and then Trace.

  5. When you are in context of one domain or one farm and looking at logs, the related messages are confined to that one domain or one farm. For example, to view messages that are related by time or ECID, click View Related Messages and select by Time or by ECID (Execution Context ID).

    The Related Messages page is displayed.

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 Cloud Control 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.

28.1.1.1 Restricting Access to the View Log Messages Menu Item and Functionality

You can restrict which administrators in Oracle Enterprise Manager Cloud Control 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:

  1. Log in to the Oracle Enterprise Manager 12c Cloud Control console as a super administrator.
  2. From the Setup menu, choose Security, then Administrators.
  3. Select the appropriate administrator and click Edit.
  4. Click Next twice to arrive on the Target Privileges page of the wizard.
  5. Scroll down the page and click Add in the Target Privileges section of the page.
  6. From the Search and Add: Targets popup dialog, select the appropriate targets for which the administrator should have access to view logs. Click Select.
  7. 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.
  8. 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.
  9. Notice on the Target Privileges page of the wizard the appearance of the new privilege. Click Review and then Finish to conclude the operation.

28.1.1.2 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.

28.1.2 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:

28.1.2.1 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:

  1. From the Enterprise menu, select Monitoring, select Logs, then select the target from the popup target selector.

    or

    From the Targets menu, select Middleware, click a farm. From the Farm menu, select Logs, then select View Log Messages.

    The Log Messages page displays a Search section and a table that shows a summary of the messages for the last hour.

  2. In the Search Mode secstion, you can choose to search for only Live Logs, only Archive Logs, or Both.
  3. In the Date Range section, you can select either:
    • Most Recent: If you select this option, select a time, such as 3 hours. The default is 10 minutes.

    • Time Interval: If you select this option, select the calendar icon for Start Date. Select a date and time. Then, select the calendar icon for End Date. Select a date and time.

  4. In the Message Types section, select one or more of the message types.
  5. You can specify more search criteria, for example, by providing text in the Message text field, so you can search on explicit words or patterns across log files.You can specify more search criteria, as described in Searching Log Files: Advanced Searches.
  6. Click Search.
  7. To help identify messages of relevance, in the table, for Show, select one of the following modes:
    • Messages - You can select an operator, such as contains and then enter a value to be matched.

      To see the details of a particular message, click the message. The details are displayed below the table of messages.

      To view related messages, select a message, then click View Related Messages and select by Time or by ECID (Execution Context ID).

    • Application ID - Groups messages related to a particular application.

    • ECID + Relationship ID - Groups messages by Execution Context (ECID) and Relationship ID (RID) which enables you to use log file entries to correlate messages from one application or across application server components. By searching related messages using the message correlation information, you can examine multiple messages and identify the component that first generated the problem.

    • Host - Groups messages associated with a particular host.

    • Host IP Address - Groups messages associated with a particular host IP address.

    • Incident ID

    • Message Type - Groups messages for each target based on the message type. It displays the total number of messages available for each message type, for example, ERROR, INCIDENT ERROR, WARNING, NOTIFICATION, TRACE, and UNKNOWN for every target.

    • Message ID - Groups messages based on the combination of Message ID, Message Type, Target, Message Level, Component, Module, and Organization.

    • Module - Groups the classes / modules that originated the message.

    • Target

    • Thread ID - Groups messages by Thread ID

    • User - Groups all messages for a particular user. For example, all the messages for user Jones will be listed before the messages for user Smith.

28.1.2.2 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.

28.1.3 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:

  1. 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.

  2. Search for particular types of messages as described in Searching Log Files: Basic Searches.

  3. 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.

  4. 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 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.

  2. Search for particular types of messages as described in Searching Log Files: Basic Searches.

  3. For Show, select Group by Message Type or Group by Message ID.

  4. 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.

  5. 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.

  6. Select either Open With or Save to Disk. Click OK.

To download the log files for a specific component:

  1. From the Enterprise menu, select Monitoring, then select Logs.

    or

    From the Targets menu, select Middleware, click a domain. From the Farm menu, select Logs, then select View Log Messages.

    The Log Messages page is displayed.

  2. Expand the Selected Targets section because it is hidden by default. Click Target Log Files.

    The Log Files page is displayed.

    Select one of the possibly many Target Log Files icons. Select the icon that is associated with the target type log files you want to view.

  3. Select a log file and click Download.
  4. An Opening dialog box is displayed.
  5. Select either Open With or Save to Disk. Click OK.