Oracle® Application Server Administrator's Guide
10g Release 2 (10.1.2) B13995-06 |
|
Previous |
Next |
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:
The Application Server Control Console lets you 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 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 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:
Log File Messages by Component
Note: Some Oracle Application Server components do not support ODL. Other components support ODL, but do not enable ODL by default. |
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 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 |
---|---|---|---|
ODL |
Yes |
|
|
BPEL Process Manager |
Text |
No |
|
Text |
No |
|
|
ODL |
Yes |
|
|
Text |
No |
Discoverer Viewer is an OC4J application. The log file is named |
|
Text |
No |
|
|
Forms |
Text |
No |
|
Text |
Yes |
|
|
Text |
No |
|
|
ODL |
Yes |
|
|
Integration Business Activity Modeling |
Text |
No |
|
ODL |
Yes |
|
|
Text |
Yes |
|
|
Text |
No |
From the command line, for administrator use only, messages are stored at: Logging for user and administrator usage, other than command line, is stored in the database and accessed through the Oracle Application Server Certificate Authority (OCA) Administrator web interface. |
|
Text |
No |
|
|
Text |
No |
|
|
Text |
No |
|
|
Reports Server |
Text |
No |
|
Text |
No |
|
|
Text |
No |
The log file location is specified with the |
|
Text |
No |
|
|
Text |
No |
|
|
Text |
Yes |
|
The Application Server Control Console supports viewing diagnostic messages from a Log Repository. A Log Repository can be file-based or stored in a database, and contains messages collected from multiple diagnostic log files across components. The Log Repository does not contain messages from access or trace log files because access logs and trace logs are verbose and do not contain diagnostic information.
The Oracle Application Server Log Loader component initializes and updates the data in a Log Repository. After the Log Loader starts, it stores information from diagnostic log files to the Log Repository at regular intervals.
Using a Log Repository consolidates Oracle Application Server log file data. Then, you can use the Application Server Control Console 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 the Application Server Control Console or OPMN to start Log Loader. See Section 5.5.1, "Starting and Stopping Log Loader". |
Administrators configure logging options to manage and limit the logging information that Oracle Application Server components generate and save.
Note: The Application Server Control Console does not directly support configuring logging options. In many cases, to configure component logging options, you need to use the Application Server Control Console Advanced Server Properties page to edit the values in configuration files. |
The logging configuration options 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: Oracle Application Server component documentation for information on setting logging configuration options |
Use Application Server Control Console to list log files by selecting the Logs link on the Application Server Control Console. This displays the View Logs page.
See Also: Section 5.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:
You can list the log files for individual components from the Application Server Control Console. To list the log files, perform the following steps:
Select the Logs link on the Application Server Control Console. The View Logs page is displayed.
To view all components, click Move All to move all available components to Selected Components. To view some components, select them in the Available Components box and click Move.
Click Search to list the log files for the selected components.
After the search returns, the Results section shows log file information such as the name of the component associated with a log file and a link to the log file.
Figure 5-1 shows the Application Server Control Console View Logs page after a search.
Figure 5-1 Enterprise Manager View Logs Search Results
After you select a system component link on the Application Server Control Console Home page, you can view the log files for the selected component by clicking Logs at the top of the page. When you click Logs, the Application Server Control Console searches for the log files associated with the current component. Then, you can view the log files on the resulting View Logs page by selecting the links in the Log Files column in the Results table.
For example, if you click Logs on the HTTP Server Home page, Enterprise Manager searches for the log files associated with the Oracle HTTP Server and displays the View Logs page with a list of Oracle HTTP Server log files in the Results table.
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.
You can filter the search for log files by certain log file attributes by using the Advanced Search page of the Application Server Control Console.
You can list log files using a search filter by performing the following steps:
Select the Logs link on an Application Server Control Console page. The View Logs page is shown.
Click Advanced Search to display the View Logs Advanced Search page. The Advanced Search page lets you list log files for Oracle Application Server components and enables you to filter the search for log files by certain log file attributes.
Select the desired components from the Available Components box and click Move or Move All to move components to the Selected Components box.
Select a field from the Log File Attribute list.
Click Add Row to add a row for the selected log file attribute.
Enter the desired search value in the Value field.
If you want to select additional fields with values, click Add Another Row and enter additional values.
Click Search to perform the search. When the search returns, the Results section shows log files with matching fields.
To obtain more information on filtering using log file attributes, click the information icon next to the Log File Attribute list.
Figure 5-2 shows the Advanced Search Filter By Log File Attributes selection box, with the Log File Attribute list and the Add Another Row button.
Figure 5-2 Log Files Advanced Search Filter By Log File Attributes
The Application Server Control Console 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:
The Log Repository must contain diagnostic messages before you can search the Log Repository. The Log Repository is initialized and updated by the Log Loader component, and the Log Loader must be started before you can search the Log Repository. The Log Loader is not started automatically; you must start the Log Loader to make sure that the Log Repository is updated.
See: Section 5.5, "Using Oracle Application Server Log Loader" for information on starting and using Log Loader. |
To search for diagnostic log entries in the Log Repository using simple search criteria, do the following:
Select the Logs link on an Application Server Control Console page. The View Logs page is shown.
From the View Logs page, click Search Log Repository.
Select components from the Available Components box, then click Move or Move All to move the selected components to the Selected Components box. This step is optional.
Use the default selections, or select the available search and result display options. The online help describes the available search and display options for the Search Log Repository page.
Note: The Message Type selection box includes the Unknown option. Some components do not include a message type when the component writes log file entries. These messages are loaded into the Log Repository with Unknown specified as the message type. |
Click Search to search for messages in the Log Repository that match the constraints you specify. When the search returns, the Results section shows the matching diagnostic log messages from the Log Repository.
Figure 5-3 shows the Search Log Repository page.
See Section 5.3.4, "Viewing Repository Log Entry Details" for information about viewing the log entry details.
With the Advanced Search feature, you can select from a set of repository query fields that can restrict the list of log message entries to those that apply to your criteria.
Take the following steps:
Select the Logs link on an Application Server Control Console page. The View Logs page is shown.
From the View Logs page, click Search Log Repository, then click Advanced Search.
On the Search Log Repository Advanced Search page, use the Filter By Log Entry Fields box to select log message fields and values to search. Select multiple fields by clicking Add Another Row. When you specify values for multiple fields, the search only returns results that match all of the specified constraints. The online help describes the available search and display options for the Search Log Repository page.
Use the default selections, or specify search and result date range and message type options by making selections and entering constraints.
Click Search to search for messages in the Log Repository that match the selection constraints. When the search returns, the Results section shows the matching log entries.
Figure 5-4 shows the Advanced Search Log Repository Filter By Log Entry Fields section.
Figure 5-4 Search Log Repository Advanced Search Filter By Log Entry Fields
To view a log entry, either select the link shown in the Time field of the Results area on the View Logs page, or select entries in the Select field and then click View Details. The Log Entry Details page is displayed, as shown in Figure 5-5. It displays information about the log entry, including the Message Type, Component, the Message Text, and optionally the Execution Context ID (ECID).
Figure 5-5 Log Repository Log Entry Details Page
See Also: Section 5.4, "Diagnosing Problems and Correlating Messages" for information on Execution Context IDs |
Regular expression matching is applied when the check box 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 check box is under the Message Text field. On the Advanced Search page, the Regular Expression check box is in the Filter by Log Entry Fields box. Using a regular expression in a search enables you to enter a pattern description 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.
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:
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 the Application Server Control Console, 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 diagnostic messages in the Log Repository 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 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, 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 5-2 lists the Oracle Application Server components that provide message correlation information (using an ECID), and if a component supports message correlation, but it is not enabled by default.
Table 5-2 Oracle Application Server Components Supporting Message Correlation
Component | Message Correlation Configuration Reference |
---|---|
Supports message correlation. |
|
Supports message correlation when ODL logging is enabled and when the property See also: Section 5.6.5 and Oracle Application Server Containers for J2EE User's Guide for details on enabling ODL logging in OC4J |
|
Supports message correlation. See also: Section 5.6.5 |
|
Supports message correlation. OracleAS Portal outputs the ECID with error messages in the Portal Repository Diagnostics log file. See also: "Diagnosing OracleAS Portal Problems" in the Oracle Application Server Portal Configuration Guide. |
|
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. 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
Using a Log Repository can make searching for the root cause of a problem much easier. A Log Repository consolidates log file data and enables you 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 is a process that periodically updates a Log Repository. A Log Repository stores diagnostic messages read from multiple log files across Oracle Application Server components in a single Oracle home. After the Log Loader starts, at regular intervals it reads the contents of log files incrementally and writes the contents to the Log Repository.
This section covers the following topics:
You can use the controls on the Application Server Control Console Log Loader page to start and stop the Log Loader.
Note: By default, when Oracle Application Server is installed, the Log Loader is stopped. |
To start the Log Loader, perform the following steps:
Select the Logs link on any Application Server Control Console page.
From the View Logs page, select the Search Log Repository link.
Select Log Loader.
On the Log Loader page, click Start.
On the confirmation page, you can click one of the following:
Cancel: Cancels the operation.
Start: Starts the Log Loader, but it does not load any existing log messages from component log files. Only messages that are added to the component logs after the Log Loader is started are added to the Log Repository.
Start and Load Existing Logs: Starts the Log Loader and loads all existing log messages from component log files. Any messages that are added to the component logs after the Log Loader is started are also added to the Log Repository.
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, but not started. When you disable the Log Loader, Enterprise Manager stops the Log Loader and the Log Loader component does not appear in the list of components on the View Logs page.
When you enable the Log Loader, the Log Loader component appears in the components list on the View Logs page, but it is not started.
When the Log Loader starts, it loads configuration information about the component log files it will use as sources for the diagnostic messages that are stored in the Log Repository. (This includes information on the location and format of the log files).Most log configuration files are installed when Oracle Application Server components are configured. The log configuration files for HTTP Server, OPMN, OC4J, and the Log Loader are generated when the Log Loader is initially started.If configuration changes are made that effect the location of diagnostic log files for these components, click Update Log Configuration on the Log Loader page to regenerate the log configuration files for these components. This ensures the Log Loader is loading the correct set of logs into the Log Repository.
You can set Log Loader properties from the Log Loader page. To navigate to the Log Loader page:
Select the Logs link on any Application Server Control Console page.
From the View Logs page, select the Search Log Repository link.
Click Log Loader.
Select the Log Loader Properties link in the Administration section. The Log Loader Properties page includes fields showing the current values for the Log Loader properties.
To change the Log Loader properties, perform the following steps:
Enter updated values in the appropriate fields on the Log Loader Properties page.
Click Apply to apply the new values.
Figure 5-6 shows the Application Server Control Console Log Loader Properties page.
The Application Server Control Console 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:
Errors in the Log Loader configuration file (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.
Configuration errors that occur when a component's registration file contains errors (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:
XML syntax errors that prevent the file from being parsed. If such errors are encountered, the Log Loader completely ignores the contents of the file.
A wrong path specified for a configuration file. If the Log Loader cannot find a log file at the specified path, it issues a Warning level diagnostic message. This does not always indicate an error. For example, it is possible that the component that generates that log was not active when the Log Loader started and the log file had not been created yet. The Log Loader continues to look for the log file and starts reading messages when the log file is created.
Errors may occur while the Log Loader is reading messages from a log file. If the log file includes contents that cannot be read or parsed, then the Log Loader issues a log message indicating that it cannot read part of the contents of the file. In this case, the Log Loader attempts to recover from the error and continue to read the Log File.
Errors may occur when writing messages to the repository (for example, a disk error). This type of error may indicate a problem that may require attention from the system administrator to correct the problem.
The Log Loader produces an error message when it skips reading log files because a log file exceeds the currently specified maximum load size. The maximum load size can be specified on the Log Loader properties page.
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 of x bytes. Skipping y_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 the Application Server Control Console for viewing log messages. The printlogs
tool 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:
Read log messages from the Log Repository or individual log files
Filter log messages according to timestamp or log field value
Print log messages in ODL or text format
Sort log messages by field
Report the number of log messages of a specified type
Run in a continuous loop, printing log reports and sleeping for a specified amount of time
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.
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>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>
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 |
---|---|---|
|
The product or component ID for the component that originated the message. |
Required |
|
The DNS host network ID. |
Optional |
|
The IP or other network address for the originating host. |
Optional |
|
The ID of the client or security group that the message relates to. |
Optional |
|
The ID for the module that originated the message. |
Optional |
|
The name of the group the message belongs to, for purposes of selecting similar messages. |
Optional |
|
The message ID. The message ID uniquely identifies the message. |
Optional |
|
An integer value that qualifies the message type ( |
Optional |
|
The type of the message. Possible values are: |
Required |
|
The organization ID for the originating component. This is usually the domain name for the organization. |
Optional |
|
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 |
|
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 |
|
The timestamp with local time zone. This specifies the date and time when the message was generated. |
Required |
|
The User ID associated with the message. |
Optional |
Using ODL provides the following benefits:
ODL limits 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 maximum segment size, it is renamed and a new log file, log.xml
is created. (You can specify the maximum ODL segment size 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 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.
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
.
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, which 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 (OPMN). When log entries do not contain a timestamp, the Log Loader sets 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:
The initial value of the last known timestamp is zero. Note that whenever adding a log record to the repository, a zero value timestamp is converted to the current time.
If the Log Loader finds an OPMN generated timestamp, it sets the last known timestamp with its value.
When the Log Loader reaches the end of the log, it sets the last known timestamp with the current time. If the Log Loader is running regularly, such as once every five minutes, this results in timestamps that are approximate to the actual time the message was written, within a five minute range. If the Log Loader is not run frequently, the value of these timestamps could be inaccurate.
Note: The OC4J redirected logs found in theORACLE_HOME /opmn/logs directory are not treated as unformatted logs, because each line in the OC4J logs contains a timestamp. Most other logs in this directory are treated as unformatted logs, and have timestamps assigned according to the preceding rules.
|
The Application Server Control Console 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 5-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 5-4 Component IDs for Diagnostic Log File Configuration
Component Name | Component ID |
---|---|
ADF |
ADFBC |
B2B |
INTEGRAT |
BPEL Process Manager |
INTEGBPM |
DCM |
DCM |
Discoverer |
DISCOVER |
Enterprise Manager |
EM |
Forms Services |
FORMS |
HTTP Server |
OHS |
Infrastructure Database |
RDBMS |
InterConnect |
INTEGIC |
Internet Directory |
OID |
Listener for Infrastructure Database |
LISTENER |
Log Loader |
LOGLOADER |
OC4J |
OC4J |
OPMN |
OPMN |
Port Tunneling |
IASPT |
Portal |
PORTAL |
Report Services |
REPORTS |
Single Sign-On |
SSO |
TopLink |
TOPLINK |
Ultra Search |
ULTRSRCH |
Universal Installer |
OUI |
Web Cache |
WEBCACHE |
Wireless |
WIRELESS |
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 and for OC4J, an ECID.
This section covers the following topics:
See Table 5-1 for the complete list of Oracle Application Server components that produce ODL messages.
Table 5-5 Oracle Application Server Components with Options for Supporting ODL
Component | Default Format | ODL Support | LocationFoot 1 |
---|---|---|---|
HTTP Server |
Text |
Yes |
ORACLE_HOME/Apache/Apache/logs
|
OC4J Instance |
Text |
Yes |
ORACLE_HOME/j2ee/instance_name/log ORACLE_HOME/j2ee/application-deployments/application_name/application.log |
To configure the Oracle HTTP Server to produce ODL messages, perform the following steps:
Add a directory named oracle
where the Oracle HTTP Server ODL messages will be stored. The directory should be located at the following location:
(UNIX) ORACLE_HOME/Apache/Apache/logs (Windows) ORACLE_HOME\Apache\Apache\logs
Using the Application Server Control Console or the dcmctl
command line utility, modify the httpd.conf
file to set the value of the OraLogMode and OraLogSeverity directives. Using the Application Server Control Console, 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
Using the Application Server Control Console, restart the HTTP Server.
See Also: Oracle HTTP Server Administrator's Guide for details on using the 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 the Application Server Control Console. Select the Administration link for the OC4J instance for which 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 the Application Server Control Console, do the following:
Select the Administration link on the OC4J Home page of the application server instance of interest.
Select Server Properties in the Instance Properties area.
Scroll down to the Multiple VM Configuration section. This section defines the ports and the command line options for OC4J and for the JVM that runs OC4J processes.
In the Command Line Options section, add the following at the end of the Java Options text field:
-Doracle.dms.transtrace.ecidenabled=true
Click Apply.
Note the following when setting the oracle.dms.transtrace.ecidenabled
property:
The default value for oracle.dms.transtrace.ecidenabled
is false
.
The property applies for the entire OC4J instance and it cannot be set to different values for different applications running on OC4J.
When ODL is enabled for OC4J and the value for oracle.dms.transtrace.ecidenabled
is 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.
See Also: "Advanced Configuration Development, and Deployment" in Oracle Application Server Containers for J2EE User's Guide |
You can use SQL scripts to create and manage a database repository for diagnostic messages. By creating a database repository for diagnostic messages, you can search, view, and correlate diagnostic messages across multiple Oracle Application Server instances.
Use the SQL scripts described in the following sections to create and manage a repository for diagnostic messages. The scripts are located in the following directory:
On UNIX:
ORACLE_HOME/diagnostics/admin
On Windows:
ORACLE_HOME\diagnostics\admin
The database that hosts the Log Repository can be an Oracle9i database or an Oracle Database 10g database.
To create a diagnostic message database repository, take the following steps:
Make sure the ORACLE_HOME and ORACLE_SID environment variables are set.
On UNIX systems, set the LD_LIBRARY_PATH, LD_LIBRARY_PATH_64, LIB_PATH, or SHLIB_PATH environment variables to the proper values, as shown in Table 1-1. The actual environment variables and values that you have to set depend on the type of your UNIX operating system.
Choose an existing tablespace or create a new tablespace for the repository.
To create a new tablespace, connect to an Oracle database as an administrator and run the script dmrep_tablespace.sql
. This script requires two arguments: the name of the tablespace to be created and the location of the tablespace datafile, for example:
SQL> connect SYS as SYSDBA; ... SQL> @ORACLE_HOME/diagnostics/admin/dmrep_tablespace.sql dmrep ORACLE_HOME/diagnostics/repository/dmrep.dbf
Choose an existing user or create a new user.
To create a new user, connect to the Oracle database containing the tablespace for the repository as an administrator and run the script dmrep_user.sql
. This script requires three arguments: name of the user, user password, and the default user tablespace. Use the tablespace you designated for the repository for the default user tablespace, for example:
SQL> @ORACLE_HOME/diagnostics/admin/dmrep_user.sql dmrepusr dmreppw dmrep
Create the diagnostic message repository schema.
To create the diagnostic message repository schema, run the script dmrep_create.sql
. Connect to the new or existing tablespace as the designated user, for example:
SQL> connect dmrepusr ... SQL> @ORACLE_HOME/diagnostics/admin/dmrep_create.sql
Change the Log Loader configuration to use the diagnostic message repository.
In order for the Log Loader to load diagnostic messages into the repository, you must update the repository element in the logloader.xml
file. To edit the repository element, you must know the JDBC URL for the database hosting the diagnostic message repository. Replace the contents of the repository element with the following:
<repository> <database_repository url="jdbc:oracle:thin:@DB host:DB port:DB instance" user="dmrepusr"/> </repository>
Replace the variables in the preceding example with the values for your installation.
Store the repository password for your installation in a wallet in the Log Loader configuration directory, using the following command:
(UNIX) ORACLE_HOME/diagnostics/bin/logloader -storePassword -user dmrepusr -pwd dmreppw (Windows) ORACLE_HOME\diagnostics\bin\logloader -storePassword -user dmrepusr -pwd dmreppw
If your installation is part of an OracleAS Cluster, update the Log Loader configuration in one instance of the cluster and then run the following command to propagate the changes to the other instances in the cluster:
(UNIX) ORACLE_HOME/dcm/bin/dcmctl updateConfig -ct logloader (Windows) ORACLE_HOME\dcm\bin\dcmctl updateConfig -ct logloader
Use the script dmrep_drop.sql
to delete messages that are older than a specified number of days, hours, minutes, or seconds. The script takes two arguments:
N, which is the number of units
Unit, which must be one of the following: DAY, HOUR, MINUTE, or SECOND
The following is an example of the script with arguments:
SQL> @ORACLE_HOME/diagnostics/admin/dmrep_cleanup.sql 7 DAY
Use the script dmrep_drop.sql
to delete the schema for the diagnostic message repository. The following is an example of deleting the DMREP schema:
SQL> connect dmrepusr
...
SQL> @ORACLE_HOME/diagnostics/admin/dmrep_drop.sql
To delete the user and tablespace, connect to the database as administrator and run the SQL commands for dropping a user and dropping a tablespace. The following example drops a user and tablespace, including contents and datafiles:
SQL> connect sys as sysdba ... SQL> drop user dmrepusr; SQL> drop tablespace dmrep including contents and datafiles;
If you want to use a file-based repository instead of a database repository for the diagnostic message repository, you must update the repository element in the logloader.xml file. Replace the contents of the repository element with the following:
<repository> <xml_repository path="diagnostics/repository" encoding="utf-8" segmentSize="5242880" maxSize="52428800"/> </repository>
If your installation is part of an OracleAS Cluster, update the Log Loader configuration in one instance of the cluster and then run the following command to propagate the changes to the other instances in the cluster:
(UNIX) ORACLE_HOME/dcm/bin/dcmctl updateConfig -ct logloader (Windows) ORACLE_HOME\dcm\bin\dcmctl updateConfig -ct logloader
Note the following limitations and configuration issues with 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 directory ORACLE_HOME
/diagnostics/config/registration
to make their log files visible to the Application Server Control Console. Some Oracle Application Server component log files are not exposed through Application Server Control Console pages.
If you shut down the Log Loader after the database is shutdown, and you restart Log Loader after the database is restarted, some messages may be reloaded to the repository database twice.
Usually, Log Loader saves its state after each load. However, if the database is shutdown first, Log Loader does not save its state. When it restarts, it resets its state to the end of the last successful load and will repeat any load that was unsuccessful. If the repository database was shutdown in the middle of that load, some of the records may have been written to the repository database, but the entire load will be repeated.