Skip Headers
Oracle® Application Server Administrator's Guide
10g Release 3 (10.1.3.1.0)

Part Number B28940-01
Go to Documentation Home
Home
Go to Book List
Book List
Go to Table of Contents
Contents
Go to Index
Index
Go to Master Index
Master Index
Go to Feedback page
Contact Us

Go to previous page
Previous
Go to next page
Next
View PDF

5 Managing Log Files

Oracle Application Server components generate log files containing messages that record all types of events, including startup and shutdown information, errors, warning messages, access information on HTTP requests, and additional information. This chapter describes how to view and manage log files to assist in monitoring system activity and in diagnosing system problems.

It contains the following topics:

5.1 Listing and Viewing Log Files with Application Server Control

With the Application Server Control Console, you can list and search log files across Oracle Application Server components. You can view log files from the Application Server Control Console pages or download a log file to your local client and view the log files using another tool.

This section covers the following:

5.1.1 Viewing Log Files

You can view the log files for a specific component with Application Server Control Console:

  1. Select a system component link on the Application Server Control Console Home page, then select the Logs link. The Log Files page is displayed.

  2. You can choose to view application logs, diagnostic logs, management system logs, or Web services log, or all types of logs by selecting a option from the View menu.

  3. In the table, expand items until you see a list of log files for the component. For example, expand Components, expand Enterprise Manager, and Application Server Control. The log files are listed in the table, as shown in Figure 5-1.

    Figure 5-1 Enterprise Manager Log Files Page

    Enterprise Manager View Logs Search Results
    Description of "Figure 5-1 Enterprise Manager Log Files Page"

  4. For any particular log file, click View. The log file text is displayed.

5.1.2 Listing Log Files for Components

You can list the log files for individual components, some components, or all components by using the Application Server Control Console. To list the log files, perform the following steps:

  1. Select a system component link on the Application Server Control Console Home page, then select the Logs link. The Log Files page is displayed.

  2. You can choose to view application logs, diagnostic logs, management system logs, or Web services log, or all types of logs by selecting them from the View menu.

  3. To view all components, select Components in the table. To view some components, expand the Components item, then expand items under Components until you reach the level you want. Then, select those components.

  4. Click Search to list the log files for the selected components.

  5. On the Search Logs page, which is displayed when the search returns, click Show Selected Log Files. The Search Logs page shows the names of the log files.

5.1.3 Searching Log Files and Viewing Messages

You can filter the search for log files by certain log file attributes by using the Search Logs page of the Application Server Control Console.

Take the following steps:

  1. Select a system component link on the Application Server Control Console Home page, then select the Logs link. The Log Files page is displayed.

  2. Select the type of log files by selecting it in the View menu.

  3. To view the log files of specific components, select them in the table.

  4. Click Search. The Search Logs page is displayed.

  5. Specify the Search criteria, such as Date Range or Message Type.

  6. Click Advanced Search Options to display the Filter by Log Message Fields table.

  7. Select a field from the Log Message Field list.

  8. Click Add Row to add a row for the selected log message field.

  9. Enter the desired search value in the Value field.

  10. To indicate this is a regular expression, click Regular Expression. (See Section 5.1.4 for information about regular expressions.)

  11. If you want to select additional fields with values, click Add Another Row and enter additional values.

  12. Click Search to perform the search. When the search returns, the Results section shows log files with matching fields, as shown in Figure 5-2.

    Figure 5-2 Log Search Results Section

    Log Repository Log Entry Details Page
    Description of "Figure 5-2 Log Search Results Section"

  13. To view a log entry, click Show in the Details column of the Results area on the Search Logs page.

    The details of the error message are displayed. This information includes the Component Name and ID, Message Level, Module ID, Message Type, Message Text, and optionally the Execution Context ID (ECID).

5.1.4 Using Regular Expressions with Search

Regular expression matching is applied when you select the check box in the Regular Expression field on the Search Logs page. You can specify a regular expression for the Message Text field and for the Filter by Log Message Fields table. Using a regular expression in a search enables you to enter a pattern description to match strings for a search.

The search uses the Apache Jakarta regular expression engine, which uses "*" for a string of characters, "?" for a single character, and supports boundary matches, including "^" for a match only at the beginning of an entry, and "$" for a match only at the end of an entry, and special characters, including "\t" for Tab, "\n" for newline, "\r" for return, and "\f" for form feed.


See Also:

http://jakarta.apache.org/regexp for more information on supported regular expressions

5.2 Understanding Oracle Application Server Logging

This section provides information about message formats and log file naming and explains how to configure logging options for components. This section covers the following topics:

5.2.1 Understanding Log File Formats and Naming

Log files of Oracle Application Server components use either text-base formatting or Oracle Diagnostic Logging (ODL).

Using ODL, log file naming and the format of the contents of log files conforms to an Oracle standard and the diagnostic messages are written in XML. Some Oracle Application Server components do not use ODL, and write their diagnostic messages using a component-specific text format. Other components support ODL, but do not enable ODL by default.

Regardless of the format, ODL or text based, of the messages that are stored in log files, you can view log files using the Application Server Control Console, or you can download log files to your local client and view them using another tool (for example a text editor, or another file viewing utility).

This section covers the following topics:

5.2.1.1 ODL Message Formatting and ODL Log File Naming

When Oracle Application Server components run and produce ODL messages, the messages are written to diagnostic log files using XML format. Each ODL message includes a HEADER element containing fields with information about the message, optionally a CORRELATION_DATA element containing information to assist in correlating messages across components, and a PAYLOAD element containing the message text, including optional arguments and associated values.

Using ODL, Oracle Application Server components write diagnostic log files to a logging directory and determine the names for logging directories using a component-specific naming convention.

5.2.1.2 Log File Message Formats by Component

Table 5-1 lists the supported message formats for each Oracle Application Server component. Several components optionally support ODL format, where ODL is not the default format.

Table 5-1 Diagnostic Message Format by Component

Component Default Format ODL Support LocationFoot 1 

Application Server Control Console

Text

No

ORACLE_HOME/j2ee/home/log/ascontrol.log

ORACLE_HOME/j2ee/home/log/home_default_group-1/

HTTP Server

Text

Yes

ORACLE_HOME/Apache/Apache/logs/error_log.time

BPEL Process Manager

Text

No

ORACLE_HOME/j2ee/instance_name/application-deployments/orabpel/instance_group_process/application.log

Business Activity Monitoring

Text

No

(Windows only) BAM_HOME\Logs

Enterprise Service Bus

Text

No

ORACLE_HOME/j2ee/instance_name/application-deployments/esb-dt/instance_group_process/application.log

ORACLE_HOME/j2ee/instance_name/application-deployments/esb-rt/instance_group_process/application.log

OC4J instance_name

Text

Yes

ORACLE_HOME/j2ee/instance_name/log/instance_group_process/

ORACLE_HOME/j2ee/instance_name/application-deployments/application_name/application.log

OC4J instance_name

ODL

Yes

ORACLE_HOME/j2ee/instance_name/log/instance_group_process/oc4j/log.xml

OPMN

Text

No

ORACLE_HOME/opmn/logs

ORACLE_HOME/opmn/logs/component_type~...

Port Tunneling

Text

No

ORACLE_HOME/iaspt/logs

TopLink

Text

No

Specified with the log path configuration option in the TopLink installation directory, for example: config/toplink.xml

Universal Installer

Text

No

ORACLE_HOME/cfgtoollogs

Web Services Manager

Text

No

ORACLE_HOME/j2ee/instance_name/application.log


Footnote 1 Locations are shown in UNIX format. Invert the slashes for Windows format.

5.2.2 Configuring Component Logging Options

Administrators can configure logging options to manage and limit the logging information that Oracle Application Server components generate and save.

For example, to configure logging options for OC4J components using Java logging, you modify the j2ee-logging.xml file, which is installed in the ORACLE_HOME/j2ee/home/config directory. See the chapter, "Logging in OC4J" in the Oracle Containers for J2EE Configuration and Administration Guide for more information.

The logging configuration options for components include:

  • Specifying log file names and pathnames: Most Oracle Application Server components let you specify the directory for storing diagnostic log files. Specifying the diagnostic logging directory allows administrators to manage system and network resources.

  • Limiting log file size: As Oracle Application Server components run and generate diagnostic messages, the size of the log files increases. Oracle Application Server components use one of several strategies to deal with log file size. Some components allow log files to keep increasing in size; in this case, it is the administrator's responsibility to monitor and clean up the log files. Other components, including OC4J, let you specify configuration options that limit how much log file data is collected and saved.

  • Using log file archiving: Certain Oracle Application Server components let you specify configuration options to control the size of diagnostic logging directories. This lets you determine a maximum size for the directories containing a component's log files. When the maximum size is reached, older logging information is deleted before newer logging information is saved.

  • Setting component logging levels: Certain Oracle Application Server components, including Oracle HTTP Server, allow administrators to configure logging levels. By configuring logging levels, the number of messages saved to diagnostic log files can be reduced. For example, you can set the logging level so that the system only reports and saves critical messages.


See Also:


5.3 Diagnosing Problems and Correlating Messages

Generally, administrators and others view log file data to diagnose, monitor, and search for component errors or problems that may cause component errors. The Application Server Control Console supports a unified architecture and provides cross-component tools that can assist you in these tasks.

This section covers the following topics:

5.3.1 Correlating Messages Across Log Files and Components

Certain Oracle Application Server components provide message correlation information for diagnostic messages. Message correlation information helps those viewing diagnostic messages determine relationships between messages across components. The Execution Context ID (ECID) is a globally unique identifier associated with a thread of execution. The ECID helps 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, 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.

When you view an entry on the Log Message Details page in the Application Server Control Console, if the ECID field is available, it displays the Execution Context ID as a link. Selecting the Execution Context ID link shows you all the diagnostic messages in the Log Repository with the same ECID.

You can use the ECID to track requests as they move through Oracle Application Server.

The ECID takes the following format:

request_id, sequence_number

  • The request_id is a unique string that is associated with each request.

  • The sequence_number represents the hop number of the request, as it passes through Oracle Application Server (or through the component).

    For example, Oracle HTTP Server assigns an initial sequence number of 0 to a request. After that, the sequence number is incremented as the request moves through Oracle Application Server components.

Table 5-2 lists the Oracle Application Server components that provide message correlation information (using an ECID), and specifies if a component supports message correlation, but it is not enabled by default.

Table 5-2 Oracle Application Server Components Supporting Message Correlation

Component Support for Message Correlation

OC4J

Supports message correlation.

HTTP Server

Supports message correlation.


5.3.2 Diagnosing Component Problems

When an Oracle Application Server component has a problem, you can isolate and determine the cause of the problem by viewing the diagnostic messages. The following general techniques can assist you in accomplishing this task:

  • Search for errors or warnings related to the problem

  • Correlate the errors across components

  • Correlate the errors across a time interval

  • Perform component-based analysis

5.4 Advanced Logging Topics

This section covers the following topics:

5.4.1 Understanding ODL Messages and ODL Log Files

This section covers the following topics:

5.4.1.1 ODL Message Contents

Using ODL, diagnostic messages are written to log files using XML format and each message includes a HEADER element containing information about the message, optionally a CORRELATION_DATA element containing information to assist in correlating messages across components, and a PAYLOAD element containing the message text including optional arguments and associated values.

Example 5-1 shows a sample ODL format message that includes the optional CORRELATION_DATA element.

Example 5-1 Sample ODL Message Content

<MESSAGE>
  <HEADER>
    <TSTZ_ORIGINATING>2006-05-05T08:13:33.138-07:00</TSTZ_ORIGINATING>
    <COMPONENT_ID>tip</COMPONENT_ID>
    <MSG_TYPE TYPE="ERROR"></MSG_TYPE>
    <MSG_LEVEL>1</MSG_LEVEL>
    <HOST_ID>sta.oracle.com</HOST_ID>
    <HOST_NWADDR>140.87.7.135</HOST_NWADDR>
    <MODULE_ID>esb.server.dispatch.agent</MODULE_ID>
    <THREAD_ID>64</THREAD_ID>
    <USER_ID>oracle1</USER_ID>
  </HEADER>
  <CORRELATION_DATA>
    <EXEC_CONTEXT_ID><UNIQUE_ID>140.87.7.135:59844:1146765043873:54</UNIQUE_ID><SEQ>0</SEQ></EXEC_CONTEXT_ID>
  </CORRELATION_DATA>
  <PAYLOAD>
    <MSG_TEXT></MSG_TEXT>
  </PAYLOAD>
</MESSAGE>

Table 5-3 describes the contents of an ODL message header. For any given component that produces ODL format messages, the optional header fields may not be present in the generated diagnostic messages.

Table 5-3 ODL Format Message Header Fields

Header Field Name Description Required

COMPONENT_ID

The product or component ID for the component that originated the message.

Required

HOST_ID

The DNS host network ID.

Optional

HOST_NWADDR

The IP or other network address for the originating host.

Optional

HOSTING_CLIENT_ID

The ID of the client or security group to which the message relates.

Optional

MODULE_ID

The ID for the module that originated the message.

Optional

MSG_GROUP

The name of the group to which the message belongs, for purposes of selecting similar messages.

Optional

MSG_ID

The message ID. The message ID uniquely identifies the message.

Optional

MSG_LEVEL

An integer value that qualifies the message type (MSG_TYPE). Lower level values are for higher severity errors. Possible values are 1 through 32.

Optional

MSG_TYPE

The type of the message. Possible values are: INTERNAL_ERROR, ERROR, WARNING, NOTIFICATION, TRACE, UNKNOWN. If MSG_TYPE is included, the TYPE attribute is required when MSG_TYPE is included in the message header.

Required

ORG_ID

The organization ID for the originating component. This is usually the domain name for the organization.

Optional

PROCESS_ID

The process ID for the process, or execution unit associated with the message. Java components may use this field to specify the process ID and the thread ID, or only the thread ID.

Optional

TSTZ_NORMALIZED

The timestamp normalized for clock drift across hosts. This field is used when the diagnostic message is copied to a repository in a different hosts.

Optional

TSTZ_ORIGINATING

The timestamp with local time zone. This specifies the date and time when the message was generated.

Required

USER_ID

The User ID associated with the message.

Optional


5.4.1.2 ODL Log File Rotation and Naming

Using ODL provides the following benefits:

  • The capability to limit the total amount of diagnostic information saved.

  • Older segment files are removed and newer segment files are saved in chronological fashion.

  • Components can remain active, and do not need to be shutdown, when diagnostic logging files are cleaned.

Using ODL, Oracle Application Server components write diagnostic log files to a logging directory. Components determine the names for logging directories using a component-specific naming convention.

An ODL log is a set of log files that includes: the current ODL log file, typically named log.xml, and zero or more ODL Archives (segment files) that contain older messages. As the log file grows, new information is added to the end of the log file, log.xml. When the log file reaches the rotation point, it is renamed and a new log file, log.xml is created. (You specify the rotation point, by specifying the maximum ODL segment size, and, for some OC4J logs, the rotation time and rotation frequency using component-specific configuration options.)


Note:

Some Oracle Application Server components, in particular Oracle HTTP Server, do not support the ODL log file naming mechanism that this section describes. In Oracle HTTP Server, ODL diagnostic messages are written to a file, log.xml, that does not have a configurable size limit.

Segment files are created when the ODL log file log.xml reaches the rotation point. That is, the log.xml is renamed to logn.xml, where n is an integer, and a new log.xml file is created when the component generates new diagnostic messages.

Size-Based Log Rotation

To limit the size of the ODL log, components use a configuration option specifying the maximum size of the logging directory. Whenever the sum of the sizes of all of the files in the directory reaches the maximum, the oldest archive is deleted to keep the total size under the specified limit.


Note:

The most recent segment file is never deleted.

For example, when the maximum directory size is reached, with the starting segment file named log9872, the following files could be present in the log file directory:

File                        Size

log.xml                     10002
log9872.xml                 15000
log9873.xml                 15000
log9874.xml                 15000
log9875.xml                 15000
log9876.xml                 15000

In this case, when log.xml fills up, log9872.xml is removed and log.xml is moved to the new file log9877.xml. New diagnostic messages then are written to a new log.xml.

For example, to specify the maximum ODL segment size and maximum directory size for an OC4J application named petstore, you would add the following entry to the file ORACLE_HOME/j2ee/instance_name/application-deployments/petstore/orion-application.xml:

<log>
<odl path="../log/petstore/" max-file-size="1000" max-directory-size="10000" />
</log>

For OC4J components that are configured in the j2ee-logging.xml file, you can specify a rotation time and rotation frequency, in addition to a maximum segment size and directory size.

Time-Based Log Rotation

You specify the following properties in the <log_handler> element:

  • baseRotationTime: (Optional.) The base time for the rotation. The format for the base time can be any of the following:

    • hh:mm, for example, 04:20. This format uses the local timezone.

    • yyyy-MM-dd, for example, 2006-08-01. This format uses the local timezone.

    • yyyy-MM-ddThh:mm, for example 2006-08-01T04:20. This format uses the local timezone.

    • yyyy-MM-ddThh:mm:ss.sTZD, where TZD is the timezone indicator. TZD can be Z, indicating UTC, or {+|-}hh:mm. For example, 2006-03-01T04:20:00-08:00 represents March 1, 2006 4:20:00 in US Pacific Standard Time timezone.

    If you do not specify baseRotationTime, the default value is Jan. 1, 1970, 00:00 UTC.

  • rotationFrequency: The frequency of the rotation, in minutes. In addition, you can specify one of the following values: hourly, daily, weekly.

You specify these properties in the following file:

ORACLE_HOME/j2ee/instance_name/config/j2ee-logging.xml

For example, to specify that the log files are rotated every day at 4:00AM local time, or when they reach 2000000 bytes in size, use the following:

<log_handler name="h1" class="oracle.core.ojdl.logging.ODLHandlerFactory">
     <property name="path" value="log"/>
     <property name="baseRotationTime" value="04:00"/>
     <property name="rotationFrequency" value="daily"/>
     <property name="maxFileSize" value=" 2000000"/> 
</log_handler>

5.4.2 Component Diagnostic Log File Registration

The Application Server Control Console reads Oracle Application Server component diagnostic registration files to determine names, locations, and additional configuration information about diagnostic log files. The following directory contains the diagnostic log file registration files:

ORACLE_HOME/j2ee/instance/applications/ascontrol/ascontrol/WEB-INF/config/registration

Oracle Application Server components may have multiple registration files in the configuration registration directory.

The format for the registration files includes an Oracle Application Server component ID, and the extension .xml. Table 5-4 lists the Oracle Application Server components and their associated IDs.


Note:

Components are responsible for creating the component diagnostic registration files. Normally, Oracle Application Server administrators should not modify these files.

Table 5-4 Component IDs for Diagnostic Log File Configuration

Component Name Component ID

Enterprise Manager


EM

Oracle HTTP Server


OHS

OC4J

OC4J

OPMN

OPMN

Port Tunneling

IASPT

Oracle TopLink


TOPLINK

Oracle Universal Installer

OUI

Web Services

WEBSERVICES


5.4.3 Configuring Components to Produce ODL Messages

This section covers the following topics:

Table 5-5 lists the Oracle Application Server components that support ODL messages but that generate text messages by default. By making configuration changes, you can configure these components to produce ODL messages. (Table 5-1 lists the Oracle Application Server components that produce ODL messages.)

Table 5-5 Oracle Application Server Components with Configuration Options for Supporting ODL

Component Default Format ODL Support LocationFoot 1 

HTTP Server

Text

Yes

ORACLE_HOME/Apache/Apache/logs

OC4J Instance

Text

Yes

Applications deployed into OC4J:

ORACLE_HOME/j2ee/application-deployments/application_name/application.log

Note: the following OC4J log files use ODL by default:

OC4J components using Java logging, OPMN-managed:

ORACLE_HOME/j2ee/instance_name/log/instance_group_process/oc4j/log.xml

OC4J components using Java logging, standalone OC4J:

ORACLE_HOME/j2ee/instance_name/log/oc4j/log.xml

See "Logging in OC4J" in Oracle Containers for J2EE Configuration and Administration Guide for a complete list of log files.


Footnote 1 Locations are shown in UNIX format. Invert the slashes for Windows format.

5.4.3.1 Configuring Oracle HTTP Server to Produce ODL Messages

To configure Oracle HTTP Server to produce ODL messages, perform the following steps:

  1. Add a directory named oracle where the Oracle HTTP Server ODL messages will be stored. Create the directory as a subdirectory of the following:

    (UNIX) ORACLE_HOME/Apache/Apache/logs
    (Windows) ORACLE_HOME\Apache\Apache\logs
    
    
  2. Modify the httpd.conf file to set the value of the OraLogMode and OraLogSeverity directives. The file is located in the following directory:

    (UNIX) ORACLE_HOME/Apache/Apache/conf/httpd.conf
    (Windows) ORACLE_HOME\Apache\Apache\conf\httpd.conf
    
    

    For example:

    OraLogMode oracle
    OraLogSeverity NOTIFICATION
    
    
  3. Restart the middle-tier instance.


    See Also:

    Oracle HTTP Server Administrator's Guide for details on using the OraLogMode and OraLogSeverity directives

5.4.3.2 Configuring OC4J to Produce ODL Messages

To enable ODL logging, you add a new element, the <odl> element, within the <log> element in any of the OC4J log file configuration files. For example, to enable ODL logging for an application named petstore, you would add the following entry to the file ORACLE_HOME/j2ee/instance_name/application-deployments/petstore/orion-application.xml:

<log>
<odl path="../log/petstore/" max-file-size="1000" max-directory-size="10000" />
</log>

See Also:

The chapter "Logging in OC4J" in Oracle Containers for J2EE Configuration and Administration Guide for more information, including a list of configuration files

5.4.4 Managing OC4J Redirected stderr and stdout Files

You can set runtime options for OC4J log files that specify that redirected stderr and stdout log files be rotated when the files reach a specific size or at the particular time of day. You can also specify the maximum number of log files to keep as archives. The following example specifies that the stdout log file will be rotated at 1:30 AM each day and that the maximum number of log files is 10:

java -Dstdstream.rotatetime=1:30 -Dstdstream.filenumber=10 -jar oc4j.jar -out d:\logs\oc4j.out

See Also:

Oracle Containers for J2EE Configuration and Administration Guide for more information

5.4.5 Configuration Issue for Log Files

The Logs link in the Application Server Control Console gives you an integrated view of many Oracle Application Server component log files. However, certain log files are only available at the component level. Oracle Application Server components use the following directory to make their log files visible to the Application Server Control Console:

ORACLE_HOME/j2ee/home/applications/ascontrol/ascontrol/WEB-INF/config/registration

Some Oracle Application Server component log files are not exposed through Application Server Control Console pages.