Oracle Fusion Middleware components generate log files containing messages that record all types of events, including startup and shutdown information, errors, warning messages, and access information on HTTP requests. This chapter describes how to find information about the cause of an error and its corrective action, to view and manage log files to assist in monitoring system activity and to diagnose problems.
It contains the following topics:
Most Oracle Fusion Middleware components write diagnostic log files in the Oracle Diagnostic Logging (ODL) format. Log file naming and the format of the contents of log files conforms to an Oracle standard and, by default, the diagnostic messages are written in text format.
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 older diagnostic logging files are deleted.
You can view log files using Fusion Middleware Control or the WLST displayLogs
command, 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).
Note:
Oracle WebLogic Server does not use the ODL format. For information about the Oracle WebLogic Server log format, see Oracle Fusion Middleware Configuring Log Files and Filtering Log Messages for Oracle WebLogic Server.Using ODL, diagnostic messages are written to log files and each message includes information, such as the time, component ID, and user.
The following example shows an ODL format error messages from Oracle SOA Suite.
[2009-04-23T10:54:00.206-07:00] [soa_server1] [NOTIFICATION] [] [oracle.mds] [tid: [STANDBY].ExecuteThread: '1' for queue: 'weblogic.kernel.Default (self-tuning)'] [userId: <anonymous>] [ecid: 0000I3K7DCnAhKB5JZ4Eyf19wAgN000001,0] [APP: wsm-pm] "Metadata Services: Metadata archive (MAR) not found."
In the message, the fields map to the following attributes, which are described in Table 10-1:
2009-04-23T10:54:00.206-07:00
: Timestamp, originating
soa_server1
: Organization ID
NOTIFICATION
: Message Type
oracle.mds
: Component ID
tid: [STANDBY].ExecuteThread: '1' for queue: 'weblogic.kernel.Default (self-tuning)'
: Thread ID
[userId: <anonymous>]: User ID
ecid: 0000I3K7DCnAhKB5JZ4Eyf19wAgN000001,0
: Execution Context ID
APP: wsm-pm
: Supplemental Attribute
"Metadata Services: Metadata archive (MAR) not found."
: Message Text
By default, the information is written to the log files in ODL text format. You can change the format to ODL XML format, as described in Section 10.4.4.
Table 10-1 describes the contents of an ODL message. For any given component, the optional attributes may not be present in the generated diagnostic messages.
Table 10-1 ODL Format Message Fields
Attribute Name | Description | Required |
---|---|---|
TSTZ_ORIGINATING (TIME) |
The date and time when the message was generated. This reflects the local time zone. |
Yes |
Timestamp, normalized (time_norm) |
The timestamp normalized for clock drift across hosts. This field is used when the diagnostic message is copied to a repository on a different host. |
No |
Organization ID (org_id) |
The organization ID for the originating component. The ID is |
No |
INSTANCE_ID (INST_ID) |
The name of the Oracle instance to which the component that originated the message belongs. |
No |
COMPONENT ID (COMP) |
The ID of the component that originated the message. |
Yes |
MESSAGE_ID (MSG_ID) |
The ID that uniquely identifies the message within the component. The ID consists of a prefix that represents the component, followed by a dash, then a 5-digit number. For example: OHS-51009 |
Yes |
MESSAGE_TYPE (MSG_TYPE) |
The type of message. Possible values are: INCIDENT_ERROR, ERROR, WARNING, NOTIFICATION, TRACE, and UNKNOWN. See Table 10-4 |
Yes |
MESSAGE_LEVEL (MSG_LEVEL) |
The message level, represented by an integer value that qualifies the message type. Possible values are from 1 (highest severity) through 32 (lowest severity). See Table 10-4 |
Yes |
HOST_ID (HOST_ID) |
The name of the host where the message originated. |
No |
HOST_NW_ADDR (HOST_ADDR) |
The network address of the host where the message originated. |
No |
MODULE_ID (MODULE) |
The ID of the module that originated the message. If the component is a single module, the component ID is listed for this attribute. |
Yes |
PROCESS_ID (PID) |
The process ID for the process or execution unit associated with the message. |
No |
THREAD_ID (TID) |
The ID of the thread that generated the message. |
No |
USER_ID (USER) |
The name of the user whose execution context generated the message. |
No |
ECID |
The Execution Context ID (ECID), which is a global unique identifier of the execution of a particular request in which the originating component participates. You can use the ECID to correlate error messages from different components. See Section 10.5 |
Yes |
RID |
The relationship ID (RID), which distinguishes the work done in one thread on one process, from work done by any other threads on this and other processes, on behalf of the same request. See Section 10.5 |
No |
SUPPL_ATTRS |
An additional list of name/value pairs which contain component-specific attributes about the event. |
No |
MESSAGE TEXT (TEXT) |
The text of the error message. |
Yes |
Message Arguments (arg) |
A list of arguments bound with the message text. |
No |
Supplemental Detail |
Supplemental information about the event, including more detailed information than the message text. |
No |
Table 10-2 shows additional attributes that are rarely used.
Table 10-2 Infrequently Used ODL Format Message Fields
Attribute Name | Description |
---|---|
Group Name (group) |
The name of the group to which the message belongs. |
Client_ID (client_id) |
The ID of the client or security group to which the message relates. |
Upstream Component (upstream_comp) |
The component with whom the originating component is working on the upstream (client) side. |
Downstream Component (downstream_comp) |
The component with whom the originating component is working on the downstream (server) side. |
Detail Path (detail_path) |
A URL for the location of additional information about the message. |
For most Java components, the log file location is:
(UNIX) MW_HOME/user_projects/domains/domain_name/servers/server_name/logs (Windows) MW_HOME\user_projects\domains\domain_name\servers\server_name\logs
The default name of a log file is server-namediagnostic.log.
For system components, the default log file location is:
(UNIX) ORACLE_INSTANCE/diagnostics/logs (Windows) ORACLE_INSTANCE\diagnostics\logs
Table 10-3 shows the log file location for components of Oracle Fusion Middleware.
In the table, DOMAIN_HOME refers to the following directory, which is the WebLogic Server domain home:
MW_HOME/user_projects/domains/domain_name
In the table, ORACLE_INSTANCE refers to the following directory, which is the Oracle instance home:
MW_HOME/instance_name
Component | Log File Location |
---|---|
Oracle Application Development Framework |
DOMAIN_HOME/servers/server_name/logs/server-name-diagnostic.log |
Oracle Business Activity Monitoring |
DOMAIN_HOME/servers/server_name/logs/bam-diagnostic.log |
Oracle Business Intelligence Discoverer |
DOMAIN_HOME/servers/server_name/logs/discoverer/server/diagnostic.log DOMAIN_HOME/servers/server_name/logs/discoverer/server_name-diagnostic.log DOMAIN_HOME/servers/server_name/logs/discoverer/diagnostic.log |
Oracle Directory Integration Platform |
DOMAIN_HOME/servers/server_name/logs/server-name-diagnostic.log |
Oracle Forms Services |
MW_HOME/user_projects/domains/domain_name/servers/server_name/logs/server-name-diagnostic.log ORACLE_HOME/j2ee/DevSuite/application-deployments/forms/application.log |
Oracle Fusion Middleware Audit Framework |
DOMAIN_HOME/servers/server_name/logs/server-name-diagnostic.log |
Fusion Middleware Control |
DOMAIN_HOME/sysman/log/emoms.log DOMAIN_HOME/sysman/log/emoms.trc |
Oracle HTTP Server |
ORACLE_INSTANCE/diagnostics/logs/OHS/component_name/*.log |
Oracle Identity Federation |
DOMAIN_HOME/servers/server_name/logs/server-name-diagnostic.log |
Oracle Internet Directory |
ORACLE_INSTANCE/diagnostics/logs/OID//oid*.log ORACLE_INSTANCE/diagnostics/logs/OID/tools/*.log |
Oracle Platform Security Services |
DOMAIN_HOME/servers/server_name/logs/server-name-diagnostic.log |
Oracle Portal |
DOMAIN_HOME/servers/server_name/logs/server-name-diagnostic.log |
Oracle Reports |
ORACLE_INSTANCE/diagnostics/logs/ReportsServerComponent ORACLE_INSTANCE/diagnostics/logs/ReportsBridgeComponent ORACLE_INSTANCE/diagnostics/logs/ReportsToolsComponent |
Oracle Virtual Directory |
ORACLE_INSTANCE/config/OVD/component_name ORACLE_INSTANCE/diagnostics/logs/OVD/component_name |
Repository Creation Utility |
By default, writes to file specified in RCU_LOG_LOCATION. If not specified, attempts to write to the following locations:
|
Oracle TopLink |
DOMAIN_HOME/servers/server_name/logs/server-name-diagnostic.log |
Oracle SOA Suite |
DOMAIN_HOME/servers/server_name/logs/server-name-diagnostic.log |
Oracle Web Cache |
ORACLE_INSTANCE/diagnostics/logs/WebCache/component_name*-log |
Oracle WebCenter |
DOMAIN_HOME/servers/server_name/logs/component-diagnostic.log |
Oracle WebLogic Server |
DOMAIN_HOME/servers/server_name/logs/server_name-diagnostic.log |
Oracle Web Services Manager |
DOMAIN_HOME/servers/server_name/logs/owsm/msglogging DOMAIN_HOME/servers/server_name/logs/owsm-diagnostic.log |
You can search, view, and list log files across Oracle Fusion Middleware components. You can search and view log files using Fusion Middleware Control or you can download a log file to your local client and view the log files using another tool. You can also list and search log files using the WLST command-line tool.
This section covers the following topics:
Note the following about using the WLST commands:
To use the custom WLST logging commands, you must invoke the WLST script from an Oracle home in which the Oracle Fusion Middleware component has been installed. See Section 3.5.1.1 for more information.
The configuration commands, such as setLogLevel
, only work in connected mode. That is you must connect to a running WebLogic server before you can invoke the commands.
The configuration commands are supported for Java components that run within a WebLogic Server, but are not supported for Oracle WebLogic Server. The configuration commands are not supported for system components.
The log viewing commands work whether you are connected or not connected to a WebLogic server. If you are not connected, you must specify the path in the oracleInstance parameter. You specify either the WebLogic domain home, or the Oracle instance.
Most of the WLST logging commands require that you are running in the domainRuntime tree. For example, to connect and to run in the domainRuntime tree, use the following commands:
./wlst.sh connect('username', 'password', 'localhost:port_number') domainRuntime()
The listLoggers
, getLogLevel
and setLogLevel
commands work in config
and runtime
mode. In config
mode the commands work on loggers that are defined in the configuration file. In runtime
mode, the commands work directly with loggers that are defined in the server JVM. By default, the setLogLevel
command sets the level on the run-time logger and updates the logger definition in the configuration file. By default, the listLoggers
and getLogLevel
commands return run-time loggers.
You can search for diagnostic messages by time, type of message, and certain log file attributes by using Fusion Middleware Control or WLST commands, as described in the following topics:
You can search for diagnostic messages using standard and supplemental ODL attributes using the Log Messages page of Fusion Middleware Control. By default, this page shows a summary of the logged issues for the last hour.
You can modify the search criteria to identify messages of relevance. You can view the search results in different modes, allowing ease of navigation through large amounts of data.
The following sections describe how to search log files:
This section describes how to perform basic searches for log messages.
You can search for all of the messages for all of the entities in a domain, an Oracle WebLogic Server, a component, or an application.
For example, to search for messages for a domain:
From the WebLogic Domain menu, choose Logs, then View Log Messages.
To search for messages for a component or application, select the component or application. Then choose Logs, then View Log Messages from that target's menu.
The Log Messages page displays a Search section and a table that shows a summary of the messages for the last hour, as shown in the following figure:
In the Date Range section, you can select either:
Most Recent: If you select this option, select a time, such as 3 hours. The default is 1 hour.
Time Interval: If you select this option, select the calendar icon for Start Date. Select a date and time. Then, select the calendar icon for End Date. Select a date and time.
In the Message Types section, select one or more of the message types. The types are described in Table 10-4.
You can specify more search criteria, as described in Section 10.3.1.1.2.
Click Search.
To help identify messages of relevance, in the table, for Show, select one of the following modes:
Messages: Shows the matching messages.
To see the details of a particular message, click the message. The details are displayed below the table of messages.
To view related messages, select a message, then click View Related Messages and select by Time or by ECID (Execution Context ID).
Group by Message Type: Summarizes the matching messages by grouping them based on message type at the target level. This is the default mode.
To see the messages, click the count in one of the message type columns. The Messages by Message Type page is displayed. To see the details of a particular message, click the message. The details are displayed below the table of messages.
Group by Message ID: Summarizes the matching messages by grouping them based on message ID, message type, and module IDs at the target level.
To see the associated messages, click the count in the Occurrences column. The Messages by Message ID page is displayed. To see the details of a particular message, click the message. The details are displayed below the table of messages.
This section describes some of the advanced search mechanisms you can use.
You can refine your search criteria using the following controls in the Log Messages page:
For Message, you can select an operator, such as contains, and enter a value to be matched.
Add Fields: Click this to specify additional criteria, such as Host, which lets you narrow the search to particular hosts. Then click Add.
For each field you add, select an operator, such as contains, and enter a value to be matched.
Broaden Target Scope: Click this to expand the search to logs associated with all members of the parent of the target. For example, if you are searching an application's logs, you can expand the search to contain the Managed Server to which the application is deployed.
Selected Targets: Expand this to see the targets that are participating in the search. To add targets, click Add and provide information in the dialog box. To remove targets, select the target and click Remove.
You can search the log files using the WLST displayLogs
command. You can narrow your search by specifying criteria, such as time, component ID, message type, or ECID.
To search for error messages generated in the last 5 minutes, for the Oracle HTTP Server ohs1, use the following command:
displayLogs(target='opmn:asinst_1/ohs1', last=5)
To search for error messages generated in the last 10 minutes for the Managed Server soa_server1, use the following command:
displayLogs(oracleInstance='/scratch/oracle1/Oracle/Middleware/user_projects/domains/soa_domain', target='soa_server1', last=10)
You can narrow your search by using the query
parameter and specifying criteria, such as component ID, message type, or ECID. In the query
clause, you can specify a query expression with any of the attributes listed in Table 10-1. Some of the criteria you can use are:
Types of messages. For example, to search for ERROR and INCIDENT_ERROR messages for the Managed Server soa_server1, use the following command:
displayLogs(oracleInstance='/scratch/oracle1/Oracle/Middleware/user_projects/domains/soa_domain', target='soa_server1', query='MSG_TYPE eq ERROR or MSG_TYPE eq INCIDENT_ERROR')
A particular ECID. For example, to search for error messages with a particular ECID (140.87.134.52:13934:1186078666446:0) for the Managed Server soa_server1, use the following command:
displayLogs(oracleInstance='/scratch/oracle1/Oracle/Middleware/user_projects/domains/soa_domain', target='soa_server1', query='ecid eq 140.87.134.52:13934:1186078666446:0')
Component type. For example, to search for messages from Oracle HTTP Server instances, use the following query:
displayLogs(query='COMPONENT_ID eq ohs')
Range of time. To search for error messages that occurred within a specified range of time, you specify the attribute TSTZ_ORIGINATING with both from
and to
operators, using the following format:
displayLogs(query='TSTZ_ORIGINATING from start_time and TSTZ_ORIGINATING to end_time')
You specify the date using the following ISO 8601 time format:
2007-09-30T12:00:00:0000-08:00
For example, to display the error message from between 8:00 a.m. and 11 a.m. on April 17, 2009, use the following command:
displayLogs(query='TSTZ_ORIGINATING from 2009-04-17T08:00:00-07:00 and TSTZ_ORIGINATING to 2009-04-17T11:00:00-07:00')
To display a count of messages, grouped by specific attributes, use the groupBy
parameter to the WLST command displayLogs
. For example, to display the count of WARNING messages by component, use the following command:
displayLogs(groupBy=['COMPONENT_ID'], query='MSG_TYPE eq WARNING')
You can view the log files for a specific component using Fusion Middleware Control or WLST.
You can view the messages for all of the entities in a domain, an Oracle WebLogic Server, a component, or an application.
For example, to view the log files and their messages for a Managed Server:
From the navigation pane, expand the farm, then WebLogic Domain, and then the domain. Right-click the Managed Server name and choose Logs, then View Log Messages.
The Log Messages page displays the log files for the Managed Server and any applications running in that server.
Expand Selected Targets and in the row for a particular component or application, click the Target Log Files icon.
The View Log Files page is displayed. On this page, you can see a list of log files related to the Managed Server, as shown in the following figure:
Select a file and click View Log File.
The View Log Files page is displayed. On this page, you can view the list of messages.
To view the details of a message, select the message.
The details are displayed in the pane below the listing, as shown in the following figure:
By default, the messages are sorted by time, in ascending order. You can sort the messages by the columns Time, Message Type, or Message ID by clicking the column name.
To view messages that are related by time or ECID, click View Related Messages and select by Time or by ECID (Execution Context ID).
The Related Messages page is displayed.
You can list the log files for an Oracle WebLogic Server domain, server, an Oracle instance, or component using the WLST listLogs
command.
You can use this command while connected or disconnected. While connected, the default target is the Oracle WebLogic Server domain.
To list the log files, first use the domainRuntime command as described in Section 10.3. The following describes how to list and view log files:
To list all of the log files for the Oracle WebLogic Server soa_server1, use the following command:
wls:/soa_domain/domainRuntime> listLogs(target='server_soa') file://dadvmn0623/scratch/oracle1/Oracle/Middleware/user_projects/domains/SOA_domain/servers/soa_server1/logs/soa_server1.log 2009-03-17 16:40:45 4.9M soa_server1.log00001 2009-03-17 18:35:35 4.9M soa_server1.log00002 2009-03-17 20:30:25 4.9M soa_server1.log00003 ... file://dadvmn0623/scratch/oracle1/Oracle/Middleware/user_projects/domains/SOA_domain/servers/soa_server1/logs/soa_server1-diagnostic.log 2009-03-22 13:53:32 10M soa_server1-diagnostic-22.log 2009-03-22 19:18:32 10M soa_server1-diagnostic-23.log 2009-03-23 00:42:32 10M soa_server1-diagnostic-24.log 2009-03-23 06:07:32 10M soa_server1-diagnostic-25.log 2009-03-23 11:31:32 10M soa_server1-diagnostic-26.log 2009-03-23 16:56:32 10M soa_server1-diagnostic-27.log 2009-03-23 22:20:32 10M soa_server1-diagnostic-28.log 2009-03-24 03:45:32 10M soa_server1-diagnostic-29.log 2009-03-24 09:11:32 10M soa_server1-diagnostic-30.log 2009-03-24 14:08:32 9.2M soa_server1-diagnostic.log ...
To list the logs for the Oracle HTTP Server ohs1 in the Oracle instance asinst_1, use the following command:
listLogs(target='opmn:asinst_1/ohs1')
To list the logs while disconnected, you must specify the oracleInstance
parameter, passing it either the Oracle WebLogic Server domain or the Oracle instance home for the system component. For example, to list the log files for the Managed Server soa_server1:
listLogs(oracleInstance='/scratch/Oracle/Middleware/user_projects/domains/SOA_domain', target='soa_server1')
To view the diagnostic messages in log files, use the WLST displayLogs
command. This command works when you are either connected or disconnected.
For example, to view the messages generated in the last 10 minutes in the log files for the Oracle WebLogic Server domain, use the following command:
displayLogs(last=10) [2009-05-05T08:05:29.652-07:00] [soa_server1] [NOTIFICATION] [BEA-000628] [Common] [host: dadvmn0623] [nwaddr: 10.229.149.27] [tid: [ACTIVE].ExecuteThread: '10' for queue: 'weblogic.kernel.Default (self-tuning)'] [userId: <WLS Kernel>] [TARGET: /SOA_domain/soa_server1] [LOG_FILE: /scratch//Oracle/Middleware/user_projects/domains/SOA_ domain/servers/soa_server1/logs/soa_server1.log] Created "1" resources for pool "SOADataSource", out of which "1" are available and "0" are unavailable. [2009-05-05T08:05:29.673-07:00] [soa_server1] [NOTIFICATION] [BEA-000628] [Common] [host: dadvmn0623] [nwaddr: 10.229.149.27] [tid: oracle.integration.platform.blocks.executor.WorkManagerExecutor$1@17f5105] [userId: <anonymous>] [TARGET: /SOA_domain/soa_server1] [LOG_FILE: /scratch/Oracle/Middleware/user_projects/domains/SOA _domain/servers/soa_server1/logs/soa_server1.log] Created "1" resources for pool "SOADataSource", out of which "1" are available and "0" are unavailable. [2009-05-05T08:05:30.448-07:00] [soa_server1] [NOTIFICATION] [BEA-001128] [JDBC] [host: dadvmn0623] [nwaddr: 10.229.149.27] [tid: oracle.integration.platform.blocks.executor.WorkManagerExecutor$1@17f5105] [userId: <anonymous>] [TARGET: /SOA_domain/soa_server1] [LOG_FILE: /scratch/Oracle/Middleware/user_projects/domains/SOA _domain/servers/soa_server1/logs/soa_server1.log] Connection for pool "SOADataSource" closed.
The previous command returns the messages sorted by time, in ascending order.
To display the log files for the Oracle HTTP Server ohs1 in the Oracle instance asinst_1, use the following command:
displayLogs(target='opmn:asinst_1/ohs1')
You can search the messages by specifying particular criteria and sort the output, as described in Section 10.3.1.
See Also:
"Logging Custom WLST Commands"listLogs
and displayLogs
commandsYou can download messages using Fusion Middleware Control or the WLST command-line tool.
You can download the log messages to a file, either the matching messages from a search or the messages in a particular log file.
To download the matching messages from a search to a file using Fusion Middleware Control:
From the navigation pane, select target, such as the domain.
From the dynamic target menu, choose Logs, then View Log Messages.
The Log Messages page is displayed.
Search for particular types of messages as described in Section 10.3.1.1.
Select a file type by clicking Export Messages to File and select one of the following
As Oracle Diagnostic Log Text (.txt)
As Oracle Diagnostic Log Text (.xml)
As Comma-Separated List (.csv)
An Opening dialog box is displayed.
Select either Open With or Save to Disk. Click OK.
To export specific types of messages or messages with a particular Message ID to a file:
From the navigation pane, expand the farm, then WebLogic Domain, and then domain. Select a Managed Server.
From the dynamic target menu, choose Logs, then View Log Messages.
The Log Messages page is displayed.
Search for particular types of messages as described in Section 10.3.1.1.
For Show, select Group by Message Type or Group by Message ID.
To download the messages into a file, if you selected Group by Message Type, select the link in one of the columns that lists the number of messages, such as the Errors column. If you selected Group by Message ID, select one of the links in the Occurrences column.
The Messages by Message Type page or Message by Message ID is displayed.
Select a file type by clicking the arrow near Export All to File.
You can select one of the following:
As Oracle Diagnostic Log Text (.txt)
As Oracle Diagnostic Log Text (.xml)
As Comma-Separated List (.csv)
An Opening dialog box is displayed.
Either select Open With or Save to Disk. Click OK.
To download the log files for a specific component using Fusion Middleware Control:
From the navigation pane, expand the farm. For system components, expand the installation type, such as Web Tier and select the component. For Java components, expand the farm, then the component type, and then select the component.
From the dynamic target menu, choose Logs, then View Log Messages.
The Log Messages page is displayed.
In the Log Files column, click a log file.
The Log Files page is displayed. On this page, you can see a list of log files related to the component or application.
Select a log file and click Download.
An Opening dialog box is displayed.
Select either Open With or Save to Disk. Click OK.
You can change the log settings of Managed Servers and Java components using Fusion Middleware Control or WLST.
Note:
Note that you cannot configure options for log files of system components, which are listed in Section 3.5.2For Java components, you can configure the following options for log files:
The name and location of log files. See Section 10.4.1.
The size of log files: You can specify that a new file is created either when the log file reaches a certain size or when a particular time is reached. This is called log file rotation. See Section 10.4.2.
The level of information written to log files. See Section 10.4.3.
The format of the log files. See Section 10.4.4.
The Locale encoding. See Section 10.4.5.
You can change the name and location of log files by using Fusion Middleware Control or the WLST command-line tool.
To change the location of a component's log file using Fusion Middleware Control, navigate to the component's home page and choose Logs, then Log Configuration from the dynamic target menu.
For example, to change the name and location of a component log file using Fusion Middleware Control:
From the navigation pane, select the component.
From the dynamic target menu, choose Logs, then Log Configuration.
The Log Configuration page is displayed.
Select the Log Files tab.
In the table, select the logger and click Edit Configuration.
The Edit Log File dialog box is displayed, as shown in the following figure:
For Log Path, enter a new path.
Click OK.
In the confirmation window, click Close.
An ODL log is a set of log files that includes the current ODL log file 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, diagnostic.log
. When the log file reaches the rotation point, it is renamed and a new log file, diagnostic.log
is created. You specify the rotation point, by specifying the maximum ODL segment size, or, for the log files of some components, the rotation time and rotation frequency.
Segment files are created when the ODL log file diagnostic.log
reaches the rotation point. That is, the diagnostic.log
is renamed to diagnostic.log
n
.log
, where n
is an integer, and a new diagnostic.log
file is created when the component generates new diagnostic messages.
To limit the size of the ODL log, you can specify:
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.
By default, the log files are rotated when they reach 10 MB. The maximum size of all log files for a particular component is 100 MB.
The maximum size of the log file. You specify that a new log file be created when a specific time or frequency is reached.
Note:
After you change the log file rotation, you must restart the Managed Server for the changes to take effect.To configure log file rotation using Fusion Middleware Control for a component:
From the navigation pane, select the component.
From the dynamic target menu, choose Logs, then Log Configuration.
The Log Configuration page is displayed.
Select the Log Files tab.
In the table, select the logger and click Edit Configuration.
The Edit Log File dialog box is displayed.
In the Rotation Policy section, you can select one of the following:
Size Based: If you select this, enter the following:
For Maximum Log File Size, enter the size in MB, for example, 15.
For Maximum Size of All Log Files, enter the size in MB, for example, 150.
Time Based: If you select this, enter the following:
For Start Time, enter the date when you want the rotation to start. For example, enter 10-APR-2009.
For Frequency, you can select Minutes and enter the number of minutes, or you can select Hourly, Daily, or Weekly.
For Retention Period, you can specify how long the log files are kept. You can select Minutes and enter the number of minutes, or you can specify Day, Week, Month, or Year.
Specifying a shorter period means that you use less disk space, but are not able to retrieve older information.
Click OK.
In the confirmation window, click Close.
To specify log file rotation using WLST, use the configureLogHandler
command. You can specify size-based rotation or time-based rotation.
For example, to specify that the log files rotate daily and that they are retained for a week, use the following command:
configureLogHandler(name='odl-handler', rotationFrequency='daily', retentionPeriod='week')
To specify that the size of a log file does not exceed 5MB and rotates when it reaches that size, use the following command:
configureLogHandler(name='odl-handler', maxFileSize='5M')
You can configure the amount and type of information written to log files by specifying the message type and level. For each message type, possible values for message level are from 1 (highest severity) through 32 (lowest severity). Some components support only some of the levels for each message type. Generally, you need to specify only the type; you do not need to specify the level.
When you specify the type, Oracle Fusion Middleware returns all messages of that type, as well as the messages that have a higher severity. For example, if you set the message type to WARNING, Oracle Fusion Middleware also returns messages of type INCIDENT_ERROR and ERROR.
Table 10-4 shows the message types and the most common levels for each type.
Table 10-4 Diagnostic Message Types and Level
Message Type | Level | Description |
---|---|---|
1 |
A serious problem that may be caused by a bug in the product and that should be reported to Oracle Support. Examples are errors from which you cannot recover or serious problems. |
|
1 |
A serious problem that requires immediate attention from the administrator and is not caused by a bug in the product. An example is if Oracle Fusion Middleware cannot process a log file, but you can correct the problem by fixing the permissions on the document. |
|
1 |
A potential problem that should be reviewed by the administrator. Examples are invalid parameter values or a specified file does not exist. |
|
1 |
A major lifecycle event such as the activation or deactivation of a primary sub-component or feature. This is the default level for NOTIFICATION. |
|
NOTIFICATION |
16 |
A finer level of granularity for reporting normal events. |
1 |
Trace or debug information for events that are meaningful to administrators, such as public API entry or exit points. |
|
TRACE |
16 |
Detailed trace or debug information that can help Oracle Support diagnose problems with a particular subsystem. |
TRACE |
32 |
Very detailed trace or debug information that can help Oracle Support diagnose problems with a particular subsystem. |
The default is NOTIFICATION, level 1.
The INCIDENT_ERROR, ERROR, WARNING, and NOTIFICATION with level 1 have no performance impact. For other types and levels, note the following:
NOTIFICATION, with level 16: Minimal performance impact.
TRACE, with level 1: Small performance impact. You can enable this level occasionally on a production environment to debug problems.
TRACE, with level 16: High performance impact. This level should not be enabled on a production environment, except on special situations to debug problems.
TRACE, with level 32: Very high performance impact. This level should not be enabled in a production environment. It is intended to be used to debug the product on a test or development environment.
Table 10-5 shows the log level mappings among ODL format, Oracle WebLogic Server, and Java.
Table 10-5 Mapping of Log Levels Among ODL, Oracle WebLogic Server, and Java
ODL | WebLogic Server | Java |
---|---|---|
OFF |
OFF |
2147483647 - OFF |
INCIDENT_ERROR:1 |
(EMERGENCY) |
1100 |
INCIDENT_ERROR:4 |
EMERGENCY |
1090 |
INCIDENT_ERROR:14 |
ALERT |
1060 |
INCIDENT_ERROR:24 |
CRITICAL |
1030 |
ERROR:1 |
(ERROR) |
1000 - SEVERE |
ERROR:7 |
ERROR |
980 |
WARNING:1 |
WARNING |
900 - WARNING |
WARNING:7 |
NOTICE |
880 |
NOTIFICATION:1 |
INFO |
800 - INFO |
NOTIFICATION:16 |
(DEBUG) |
700 - CONFIG |
TRACE:1 |
(DEBUG) |
500 - FINE |
TRACE:1 |
DEBUG |
495 |
TRACE:16 |
(TRACE) |
400 - FINER |
TRACE:32 |
(TRACE) |
300 - FINEST |
TRACE:32 |
TRACE |
295 |
You can set the message level for a particular log file or for loggers.
To set the message level for a component log file:
From the navigation pane, select the component.
From the dynamic target menu, choose Logs, then Log Configuration.
The Log Configuration page is displayed.
Select the Log Files tab.
In the table, select the log file and click Edit Configuration.
The Edit Log File dialog box is displayed, as shown in the following figure:
For Log Level, select the logging level. For example, select WARNING:1 (WARNING).
Click OK.
In the confirmation window, click Close.
To set the message level for one or more loggers for a component:
From the navigation pane, select the component.
From the dynamic target menu, choose Logs, then Log Configuration.
The Log Configuration page is displayed.
Select the Log Levels tab.
For View, select Runtime Loggers or Loggers with Persistent Log Level State.
Run-time loggers are loggers that are currently active. Persistent loggers are loggers that are saved in a configuration file and log levels of these loggers are persistent across component restarts. A run-time logger can also be a persistent logger, but not all run-time loggers are persistent loggers.
In the table, to specify the same level for all loggers, select the logging level for Root Logger for run-time loggers or oracle for persistent loggers. Then, for the child loggers, specify Inherit from Parent. For most situations, that is sufficient.
However, if you need to specify the level for a particular logger, expand Root Logger or oracle, then, for the logger that you want to modify, select the logging level. For example, for the logger oracle.wsm.management.logging, select WARNING:1 (WARNING).
Click Apply.
To set the message level with WLST, you use the setLoglevel
command. To get the current message level, you use the getLogLevel
command. You must be connected to WebLogic Server before you use the configuration commands.
You can view the log level for a logger for an Oracle WebLogic Server. For example, to view the log level of the Oracle WebLogic Server soa_server1, use the following command:
getLogLevel(logger='oracle', target='soa_server1') NOTIFICATION:1
You can set the log level for a particular logger. The following example sets the message type to WARNING for the logger oracle.soa:
setLogLevel(target='soa_server1', logger='oracle.soa', level='WARNING')
To get a list of loggers for the Oracle WebLogic Server soa_server1, use the listLoggers command:
listLoggers(target='soa_server1') . . . oracle.soa | WARNING:1 oracle.soa.adapter | <Inherited> orac | <Inherited> oracle.soa.b2b.apptransport | <Inherited> oracle.soa.b2b.engine | <Inherited> oracle.soa.b2b.repository | <Inherited> oracle.soa.b2b.transport | <Inherited> oracle.soa.b2b.ui | <Inherited> . . .
You can also filter logger names using the pattern parameter and a regular expression. For example, to return all loggers that begin with oracle
in the Oracle WebLogic Server soa_server1, use the following command:
listLoggers(target='soa_server1', pattern='oracle.*') oracle | NOTIFICATION:1 oracle.adapter | <Inherited> oracle.adapter.jms.logger | <Inherited> oracle.adf | <Inherited>
By default, information is written to log files in ODL text format. You can change the format to ODL XML format.
To change the format using Fusion Middleware Control:
From the navigation pane, select the component.
From the dynamic target menu, choose Logs, then Log Configuration.
The Log Configuration page is displayed.
Select the Log Files tab.
In the table, select the log file and click Edit Configuration.
The Edit Log File dialog box is displayed.
For Log File Format, select Oracle Diagnostics Logging - XML.
Click OK.
In the confirmation window, click Close.
To specify the log file format using WLST, you use the use the configureLogHandler
command. You use the format
parameter and specify either ODL-Text or ODL-XML. ODL-Text is the default.
For example, to specify ODL XML format, use the following command:
configureLogHandler(name='odl-handler', format='ODL-XML'))
The language and data formats used in the log files are determined by the default locale of the server Java Virtual Machine (JVM). You can change them using the Language and Regional Options applet in Control Panel on Windows or the LANG and LC_ALL environment variables on a UNIX platform.
The character encoding of log files is determined by the server JVM's default character encoding or an optional configuration setting. You should choose an encoding that supports all languages used by the users, or the log file may be corrupted. By default, log is in the server JVM's default character encoding. If you change the encoding, delete or rename old log files to prevent them from being damaged by the new logs appended in a different encoding.
For support of any language, it is recommended to use Unicode UTF-8 encoding. On a UNIX operating system, setting the LANG and LC_All environment variables to a locale with the UTF-8 character set enables UTF-8 logging (for example, en_US.UTF-8
for the US locale in UTF-8 encoding). On Windows, you can enable UTF-8 logging as described in the following topics.
To specify the log file encoding using WLST, use the configureLogHandler command. You can use the encoding parameter to specify the character set encoding. JVM default encoding is the default.
For example, to specify UTF-8, use the following command:
configureLogHandler(name="odl-handler", encoding="UTF-8")
To specify the log file encoding in the logging.xml file, use an optional encoding property. You can specify the encoding property to specify the character set encoding. JVM default encoding is the default.
For example, to specify UTF-8, add the following encoding property in the log_handler element:
<property name='encoding' value='UTF-8'/>
Oracle Fusion Middleware components provide message correlation information for diagnostic messages. Message correlation information helps those viewing diagnostic messages to determine relationships between messages across components. Each diagnostic message contains an Execution Context ID (ECID) and a Relationship ID (RID):
An ECID is a globally unique identifier associated with the execution of a particular request. An ECID is generated when the request is first processed.
A RID distinguishes the work done in one thread on one process, from work done by any other threads on this and other processes on behalf of the same request.
The ECID and RID help you to use log file entries to correlate messages from one application or across Oracle Fusion Middleware components. By searching for 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.
You can use the ECID and RID to track requests as they move through Oracle Fusion Middleware.
The following shows an example of an ECID:
152.68.202.244:43750:1172674368694:1
The RID is one or more numbers separated by a colon (:). The first RID created for a request is 0. Each time work is passed from a thread that has an ECID associated with it to another thread or process, a new RID is generated that encodes the relationship to its creator. That is, a new generation is created. Each shift in generation is represented by a colon and another number. For example, the seventh child of the third child of the creator of the request is:
0:3:7
You can view all the messages with the same ECID using the WLST displayLogs
command. For example:
displayLogs(ecid='0000Hl9TwKUCslT6uBi8UH18lkWX000002')
You can search for messages with a particular ECID on the Log Messages page in Fusion Middleware Control:
From the WebLogic Domain menu, choose Logs, then View Log Messages.
To search for messages for a component or application, select the component or application and then choose Logs, then View Log Messages from that target's menu.
Specify search criteria, as described in Section 10.3.1.1.2.
Click Search.
Select a message, then click View Related Messages and select by ECID (Execution Context ID).
The messages with the same ECID are displayed, as shown in the following figure:
Trace the ECID to the earliest message. (You may need to increase the date or time range to view the first message with the ECID.)