Oracle Application Server 10g Administrator's Guide 10g (9.0.4) Part Number B10376-01 |
|
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:
Oracle Enterprise Manager Application Server Control (Application Server Control) lets you list and search log files across Oracle Application Server components. You can view log files from Application Server Control pages or download a log file to your local client and view the log files using another tool.
This section covers the following topics:
Several Oracle Application Server components use 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. Regardless of the format of the messages that are stored in log files, ODL or text based, you can view log files using Application Server Control, 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:
Some Oracle Application Server components do not support ODL. Other components support ODL, but do not enable ODL by default.
Note:
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.
Table 4-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.
Application Server Control supports viewing diagnostic messages from a Log Repository (a Log Repository stores error logs, but does not store access logs). A Log Repository contains diagnostic messages collected from multiple log files across components. The Oracle Application Server Log Loader component initializes and updates the data in a Log Repository. After the Log Loader starts, at regular intervals it stores information from diagnostic log files to the Log Repository.
Using a Log Repository consolidates Oracle Application Server log file data; this allows you to use Application Server Control to easily search and view log file data generated by multiple components. Using a Log Repository can speed up the diagnostic process and reduce the resources required to support Oracle Application Server.
Note: By default, the Log Loader is not started. Use Application Server Control to start Log Loader. |
Administrators configure logging options to manage and limit the logging information that Oracle Application Server components generate and save.
The logging configuration options include:
Oracle Application Server component documentation for information on setting logging configuration options.
See Also:
Use Oracle Enterprise Manager Application Server Control to list log files by selecting the Logs link on the Application Server Control. This brings up the View Logs page.
See Also:
Section 4.6.1, "Using the printlogs Tool to View Log Messages" for information on a command-line tool for viewing log files |
This section covers the following:
Selecting the Logs link on the Application Server Control shows the View Logs page. To list the log files, starting on the View Logs page perform the following steps:
Figure 4-1 shows the Application Server Control View Logs page after a search.
Using Application Server Control, selecting the Logs link shows the View Logs page. To list selected components log files, starting on the View Logs page perform the following steps:
Figure 4-1 shows the View Logs page Results after a search.
After you select a system component link on the Application Server Control main page, you can view the component log files by selecting the Logs link. When you select this link, Application Server Control shows the View Logs page and runs a search for the component's log files. Thus, clicking on the Logs link for pages associated with a component runs a log file search for that component. You can then view the log files by selecting the Log File links shown in the Results section.
When you select the Logs link from a component page, the log file pages include a Return to link at the bottom of each page. The Return to link returns you to the component page from which you selected the Logs link.
After selecting the Logs link on an Application Server Control page, the View Logs page is shown. Starting on the View Logs page, selecting the Advanced Search button shows the View Logs Advanced Search page. The Advanced Search page lets you list log files for Oracle Application Server components and allows you to filter the search for log files by certain log file attributes.
Starting on the View Logs Advanced Search page you can list log files using a search filter by performing the following steps:
To obtain more information on filtering using log file attributes, click the information icon next to the Log File Attribute list.
Figure 4-2 shows the Advanced Search Filter By Log File Attributes selection box, with the Log File Attribute list and the Add Row button.
After selecting the Search button from either the View Logs Simple Search or Advanced Search page, the View Logs page shows the search output at the bottom of the page in the Results section. You can sort the output by selecting column headings. For example, to sort results by size, select the Size (bytes) column heading (multiple selections on a column heading toggle ascending and descending sort).
To view log file contents, select the link shown in the Log File column.
After selecting a log file link, the Log File page shows the contents of the selected log file, and supports the following:
Application Server Control lets you search through diagnostic messages in a Log Repository containing messages collected from several Oracle Application Server components. The advantage of using a Log Repository is that you can search, view, and correlate diagnostic messages in a uniform way across multiple Oracle Application Server components.
This section covers the following topics:
To use a Log Repository for searching and viewing diagnostic messages, select the Logs link on a Application Server Control page and then select the Search Log Repository link. The Search Log Repository Simple Search and Advanced Search pages allow you to search the diagnostic messages stored in the Log Repository.
Figure 4-3 shows the Application Server Control Search Log Repository page.
The Log Repository needs to contain diagnostic messages before you can search the Log Repository. The Log Loader component initializes and updates the diagnostic messages in the Log Repository.
Note: By default, the Oracle Application Server Log Loader is not started and does not load diagnostic messages. |
See Also:
Section 4.5, "Using Oracle Application Server Log Loader" for information on starting and using Log Loader |
To search the Log Repository for diagnostic messages, go to the View Logs >
Search Log Repository page, and use the Available Components and Selected Components boxes to select components. The online help describes the available search and display options for the View Logs >
Search Log Repository page.
To search for diagnostic log entries in the Log Repository, do the following:
>
Search Log Repository page.
To search the Log Repository for diagnostic messages using advanced search, go to the View Logs >
Search Log Repository page, and select the Advanced Search button. On the View Logs >
Search Log Repository Advanced Search page, use the Filter By Log Entry Fields box to select log fields and values to search. The View Logs pages shows the diagnostic log entries with matching field values when you enter after you select the Search button.
Figure 4-4 shows the Advanced Search Log Repository Filter By Log Entry Fields box.
To display Log Repository entries matching the Advanced Search filter, perform the following steps:
>
Search Log Repository Advanced Search page.
>
Search Log Repository page.
Using either the link shown in the Time field of the Results area on the View Logs page, or by selecting entries in the Select field and then selecting the View Details button, you can view a log entry and its associated information, including the Message Type, Component, the Message Text, and optionally the Execution Context ID (ECID).
Figure 4-5 shows a log entry details page.
See Also:
Section 4.4, "Diagnosing Problems and Correlating Messages" for information on Execution Context IDs |
Regular expression matching is applied when the checkbox in the Regular Expression field is selected on the Log Repository Simple Search or Advanced Search page. On the Simple Search page, the Regular Expression checkbox is under the Message Text field. On the Advanced Search page, the Regular Expression checkbox is in the Filter by Log Entry Fields box. Using a regular expression in a search allows you to enter a pattern description that enables you to match strings for a Log Repository search.
The Log Repository 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 |
Generally Administrators and others view log file data to diagnose, monitor, and search for component errors or problems that may cause component errors. Application Server Control supports a unified architecture and provides cross component tools that can assist you in these tasks.
This section covers the following topics:
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 Entry Details page in Application Server Control, if the Execution Context ID field is available, it displays the Execution Context ID as a link. Selecting the Execution Context ID link shows you all the messages with the same execution context ID.
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 integer 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, OracleAS Web Cache assigns an initial sequence number of 0 to a request (when OracleAS Web Cache handles the request). After that, the sequence number is incremented as the request moves through Oracle Application Server components.
Table 4-2 lists the Oracle Application Server components that provide message correlation information (using an ECID).
Component | Message Correlation Configuration Reference |
---|---|
DCM |
DCM supports message correlation. |
OC4J |
OC4J supports message correlation when ODL logging is enabled and when the property See Also: "Configuring Components to Produce ODL Messages and ECIDs" Oracle Application Server Containers for J2EE User's Guide for details on enabling ODL logging in OC4J. |
HTTP Server |
Oracle HTTP Server supports message correlation. See Also: Section 4.6.5, "Configuring Components to Produce ODL Messages and ECIDs" |
Portal |
Portal supports message correlation. Portal outputs the ECID with error messages in the Portal Repository Diagnostics log file. See Also: "Diagnosing OracleAS Portal Problems" Oracle Application Server Portal Configuration Guide. |
Web Cache |
Web Cache supports message correlation. See Also: the section, "Oracle-ECID Request-Header Field" in Chapter 2, "Caching Concepts" in the Oracle Application Server Web Cache Administrator's Guide |
When an Oracle Application Server component has a problem you can isolate and determine the cause of the problem by viewing the diagnostic messages. There are general techniques that can assist you in accomplishing this task. In general, the techniques include the following:
Using a Log Repository can make searching for the root cause of a problem much easier. A Log Repository consolidates log file data and allows you use to easily search, correlate, and view log file data that is generated by multiple Oracle Application Server components. A Log Repository correlates cross component information by time, and correlates events that occur in a cascading fashion. Once a problem is isolated to a particular component in the repository, then, if needed, the problem can be further analyzed by examining the component-specific diagnostic files.
The Oracle Application Server Log Loader component works to place messages in the Log Repository. A Log Repository stores diagnostic messages from multiple log files across Oracle Application Server components. After the Log Loader starts, at regular intervals it reads the contents of log files incrementally and stores the contents to the Log Repository.
This section covers the following topics:
You can use the controls on the Application Server Control Log Loader page to start and stop the Log Loader. Starting the Log Loader starts the Oracle Application Server component that periodically updates the Log Repository. Stopping the Log Loader stops the Oracle Application Server component that periodically updates the Log Repository.
To start the log loader, perform the following steps:
On the Log Loader page, the Enable button enables the Log Loader. By default, when you first install Oracle Application Server, the Log Loader is enabled. Disabling the Log Loader specifies that the Log Loader's own log files are not shown in the component lists on the View logs page.
When the Log Loader starts, it loads configuration information about the component log files to use as source for the diagnostic messages that are stored in the Log Repository (this includes information on the location and format of the log files). If the instance is reconfigured after the Log Loader is started, for example when a new component is added, use the Update Log Configuration button to update the Log Loader configuration. Updating the log configuration lets the Log Loader reread configuration files to locate and load all the component log files into the Log Repository.
You can set Log Loader properties from the Log Loader page. To navigate to the Log Loader page:
To change the Log Loader properties, perform the following steps:
Figure 4-6 shows the Application Server Control Log Loader Properties page.
The Application Server Control online help includes detailed information on the Log Loader Properties fields.
The Log Loader logs its diagnostic messages, including errors to its log file. Diagnostic messages might include errors encountered due to an incorrect configuration, or errors that occur while the Log Loader is reading data from a log file or is writing data to the log repository.
The common Log Loader problems include:
$ORACLE_HOME/diagnostics/config/logloader.xml
). Errors in the configuration file usually prevent the Log Loader from running. Such errors need to be corrected before the Log Loader can work properly.
$ORACLE_HOME/diagnostics/config/registration/*.xml
). Errors in the registration files do not prevent the Log Loader from running but may prevent the contents of certain log files from being loaded in the repository. Typically, there are two common types of registration file errors:
In this case the Log Loader logs an error message in the following format:
Size of data to be read from log /logfile
exceeds threshold ofx
bytes. Skippingy_skipped
bytes and moving to end of log.
This message indicates the size of data to be read exceeds the specified maximum load size x, and that the Log Loader is skipping to the end of the log file. The error message provides information on the name of the log file /logfile, and the number of bytes skipped y_skipped.
This section covers the following topics:
The printlogs
tool is a command-line alternative to Application Server Control for viewing log messages. printlogs
supports a variety of options for gathering and filtering log messages, and prints the results to standard output in a single format. For example, you can use printlogs
to:
Appendix E, "printlogs Tool Syntax and Usage" for more information
See Also:
This section covers the following topics:
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.
Table 4-3 describes the contents of an ODL message header. Table 4-3 includes the optional header fields. For any given component that produces ODL format messages, the optional header fields may not be present in the generated diagnostic messages.
Example 4-1 shows a sample ODL format message that includes the optional CORRELATION_DATA
element.
MESSAGE> <HEADER> <TSTZ_ORIGINATING>2002-04-01T18:38:48.058-08:00</TSTZ_ORIGINATING> <ORG_ID>oracle.com</ORG_ID> <COMPONENT_ID>OHS</COMPONENT_ID> <HOSTING_CLIENT_ID>0.0.255.255</HOSTING_CLIENT_ID> <MSG_TYPE TYPE="ERROR"></MSG_TYPE> <MSG_LEVEL>17</MSG_LEVEL> <HOST_ID>test-perf9</HOST_ID> <HOST_NWADDR>0.0.255.255</HOST_NWADDR> <MODULE_ID>apache_core</MODULE_ID> <PROCESS_ID>5713</PROCESS_ID> </HEADER> <CORRELATION_DATA>
<EXEC_CONTEXT_ID> <UNIQUE_ID>1017715128:255..255.255.88:5713:0:1</UNIQUE_ID> <SEQ>1</SEQ> </EXEC_CONTEXT_ID> </CORRELATION_DATA> <PAYLOAD> <MSG_TEXT>File does not exist: /files/Apache/docs/images/java-apache-project.gif </MSG_TEXT> </PAYLOAD> </MESSAGE>
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
. Each ODL log can specify a maximum segment size. When the log file reaches the maximum segment size, it is renamed and a new log file, log.xml
is created (specify the maximum ODL segment size using component-specific configuration options).
Segment files are created when the ODL log file log.xml
reaches the maximum segment size. That is, the log.xml
is renamed to log
n
.xml
, where n
is an integer, and a new log.xml
file is created when the component generates new diagnostic messages.
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.
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.xml15000
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
.
Using ODL provides the following benefits:
The Log Loader reads logs in several different formats and it converts the contents of non-ODL logs to ODL format. In most cases, the resulting ODL log record will contain only a timestamp and the message text from the original log entry. Values for other ODL message fields, such as COMPONENT_ID
and MODULE_ID
can be provided in the log registration file for each log, so that these values are set to all log records parsed from the log. The Log Loader attempts to determine the severity or level of each non-ODL log and generate an appropriate ODL message type. However, in many cases, if the severity or level cannot be determined, the resulting ODL log record will have the message type set to UNKNOWN
.
The Log Loader can even read "unformatted" logs, that may not even contain timestamp values. This is the case for several logs in the $ORACLE_HOME/opmn/logs
directory which contain redirected output from Oracle Application Server processes managed by Oracle Process Manager and Notification Server. When log entries do not contain a timestamp, the Log Loader will set the timestamp to the value of the "last known timestamp" for that log. The value of the last known timestamp is determined according to the following rules:
Application Server Control and the Log Loader read Oracle Application Server component diagnostic registration files to determine names, locations, and additional configuration information about diagnostic log files. The directory $ORACLE_HOME/diagnostics/config/registration
contains the diagnostic log file registration files.
Oracle Application Server components may have multiple registration files in the configuration registration directory.
The format for the registration files includes a Oracle Application Server component ID, and extension, .xml
. Table 4-4 lists the Oracle Application Server Components and their associated Component IDs.
Note: Components are responsible for creating the component diagnostic registration files. Normally, Oracle Application Server Administrators should not modify these files. |
Table 4-5 lists the Oracle Application Server components that support ODL messages but that generate text messages by default. By making configuration changes, these components can be configured to produce ODL messages and for OC4J, an ECID.
This section covers the following topics:
See Table 4-1 for the complete list of Oracle Application Server components that produce ODL messages.
To configure the Oracle HTTP Server to produce ODL messages, perform the following steps:
oracle
where the Oracle HTTP Server ODL messages will be stored. The directory should be located at the following location:
%ORACLE_HOME/Apache/Apache/logs
dcmctl
command line utility, modify the httpd.conf
file to set the value of the OraLogMode
and OraLogSeverity
directives. Using Application Server Control, from the Administration section of the HTTP_Server page select the Advanced Server Properties link. Specify the OraLogMode
and OraLogSeverity
directives in httpd.conf
.
For example:
OraLogMode oracle OraLogSeverity NOTIFICATION
Oracle HTTP Server Administrator's Guide for details on using the
See Also:
OraLogMode
and OraLogSeverity
directives
The supplied configuration files for OC4J include commented out specifications for ODL logging. Enabling ODL logging in OC4J involves uncommenting the ODL configuration options and restarting the associated OC4J instance.
To change the ODL logging configuration for OC4J, use Application Server Control to select the Administration link for the OC4J instance that you want to enable ODL logging. Then, select the Advanced Properties link to show the Advanced Server Properties page. On this page, edit the configuration files and uncomment the lines that contain the <odl>
element.
See Also:
Chapter 3, "Advanced Configuration Development, and Deployment" in Oracle Application Server Containers for J2EE User's Guide |
OC4J supports generating an Execution Context ID (ECID) for its log file entries. You can use the ECID to track requests as they move through Oracle Application Server, or through OC4J. By default ECID generation is disabled in OC4J.
To enable ECID generation in OC4J, set the Java command-line option -Doracle.dms.transtrace.ecidenabled=true
.
To modify Java command line options using Application Server Control, do the following:
-Doracle.dms.transtrace.ecidenabled=true
Note the following when setting the oracle.dms.transtrace.ecidenabled
property:
oracle.dms.transtrace.ecidenabled
is false
.
oracle.dms.transtrace.ecidenabled=false
, OC4J uses an ECID that is generated from within OC4J, rather than receiving the ECID from Oracle HTTP Server. When ODL is enabled for OC4J, all log messages should include an ECID.
"Advanced Configuration Development, and Deployment" in Oracle Application Server Containers for J2EE User's Guide
See Also:
The Logs link in Application Server Control 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 directory $ORACLE_HOME/diagnostics/config/registration
to make their log files visible to Application Server Control. Some Oracle Application Server component log files are not exposed through Application Server Control pages.
|
![]() Copyright © 2002, 2003 Oracle Corporation. All Rights Reserved. |
|