bea.com | products | dev2dev | support | askBEA |
|
e-docs > WebLogic Server > Administration Console Online Help > Logging |
Administration Console Online Help |
WebLogic Server uses log messages to record information about events such as the deployment of new applications or the failure of one or more subsystems. The messages include information about the time and date of the event as well as the ID of the user who initiated the event.
You can view and sort these messages to detect problems, track down the source of a fault, and track system performance. For example, you can determine which user deployed a specific application or which user changed the thread pool count on a specific day. You can also create client applications that listen for these messages and respond automatically. For example, you can create an application that listens for messages indicating a failed subsystem. If a subsystem fails, the application can send email to a system administrator.
This topic contains the following sections:
For information on setting up your application to listen for messages, refer to the Using WebLogic Logging Services Guide.
Overview of WebLogic Server Log Messages and Log Files
Each subsystem within WebLogic Server generates log messages to communicate its status. For example, when you start a WebLogic Server instance, the Security subsystem writes a message to report its initialization status.
To keep a record of the messages that its subsystems generate, WebLogic Server writes the messages to log files. You can view these files with a standard text editor or the log file viewer in the Administration Console.
Note: We recommend that you do not modify log files by manually editing them. Modifying a file changes the timestamp and can confuse log file rotation. In addition, editing a file might lock it and prevent updates from a WebLogic Server.
In addition to writing messages to a log file, each server instance prints a subset of its messages to standard out. By default, it prints only messages of a WARNING severity level or higher. You can modify the severity threshold so that the server prints more or fewer messages to standard out.
The following sections provide an overview of WebLogic Server log messages and log files:
The messages for all subsystems contain a consistent set of fields (attributes) as described in the following table.
The time and date when the message originated, in a format that is specific to the locale. |
|
Indicates the degree of impact or seriousness of the event reported by the message. For more information, refer to Message Severity. |
|
Indicates the subsystem of WebLogic Server that was the source of the message. For example, EJB, RMI, JMS. |
|
Identify the origins of the message. Log messages that are generated within a client JVM client do not include these fields. For example, if your application runs in a client JVM and it uses the WebLogic logging services, the messages that it generates and sends to the WebLogic Server log files will not include these fields. |
|
The user from the security context in which the message was generated. Log messages that are generated within a client JVM client do not include this field. |
|
Present only for messages logged within the context of a transaction. |
|
A unique six-digit identifier. Message IDs through 499999 are reserved for WebLogic Server system messages. All message IDs that WebLogic Server system messages generate start with BEA-. |
|
The severity attribute of a WebLogic Server log message indicates the potential impact of the event or condition that the message reports.
The following table lists the severity levels of log messages from WebLogic Server subsystems, starting from the lowest level of impact to the highest.
WebLogic Server subsystems generate many messages of lower severity and fewer messages of higher severity. For example, under normal circumstances, they generate many INFO messages and no EMERGENCY messages.
If your application uses the WebLogic logging services, it can use an additional severity level, DEBUG. WebLogic Server subsystems do not use this severity level. For more information, refer to Writing Debug Messages in the Using WebLogic Logging Services Guide.
When a WebLogic Server instance writes a message to the log file, the first line of each message begins with #### followed by the message attributes. Each attribute is contained between angle brackets.
The following is an example of a message in a log file:
####<Nov 11, 2002 2:07:57 PM EST> <Notice> <WebLogicServer> <MyComputer> <MedRecServer> <main> <kernel identity> <> <BEA-000360> <Server started in RUNNING mode>
In this example, the message attributes are: Timestamp, Severity, Subsystem, Machine Name, Server Name, Thread ID, User ID, Transaction ID, Message ID, and Message Text.
If a message is not logged within the context of a transaction, the angle brackets (separators) for Transaction ID are present even though no Transaction ID is present.
If the message includes a stack trace, the stack trace follows the list of message attributes.
The character encoding used in writing the log files is the default character encoding of the host system.
Format of Output to Standard Out and Standard Error
Messages that are printed to standard out or standard error are formatted slightly differently.
The output does not include the #### prefix and does not include the Server Name, Machine Name, Thread ID and User ID fields.
The following is an example of how the message from the previous section would be printed to standard out:
<Nov 11, 2002 2:07:57 PM EST> <Notice> <WebLogicServer> <BEA-000360> <Server started in RUNNING mode>
In this example, the message attributes are: Timestamp, Severity, Subsystem, Message ID, and Message Text.
Local Log Files and Domain Log Files
Each WebLogic Server instance writes all messages from its subsystems and applications to a log file that is located on the local host machine.
In addition to writing messages to its local log file, each server instance forwards a subset of its messages to a domain-wide log file. By default, servers forward only messages of severity level ERROR or higher. While you can modify the set of messages that are forwarded, servers can never forward messages of the DEBUG severity level or any stack traces that are included in a message.
The domain log file provides a central location from which to view the overall status of the domain.
For more information, refer to Specifying the Messages that a Server Forwards to the Domain Log.
How a Server Instance Forwards Messages to the Domain Log
To forward messages to the domain log, each server instance broadcasts its log messages as Java Management Extensions (JMX) notifications. A server broadcasts all messages and message text except for the following:
The Administration Server listens for a subset of these messages and writes them to the domain log file. To listen for these messages, the Administration Server registers a JMX listener with each Managed Server. By default, the listener includes a filter that allows only messages of severity level ERROR and higher to be forwarded to the Administration Server. (See Figure 7-1.)
Figure 7-1 WebLogic Server Logging Services
For any given WebLogic Server instance, you can override the default filter and create a domain log filter that causes a different set of messages to be written to the domain log file. For information on setting up a domain log filter for a WebLogic Server instance, refer to Domain Log Filters.
The log messages and files that are discussed in previous sections of this topic communicate events and conditions that affect the operation of the server or the application.
Some subsystems maintain additional log files to provide an audit of the subsystem's interactions under normal operating conditions. The following list describes each of the additional log files:
You can view server logs from the following applications:
From the Administration Console
You can use the Administration Console to view the log file for any server in the domain, regardless of whether the server is located on a remote computer for which you might not have login privileges. In addition, the Administration Console's log file viewer provides filtering tools that you can use to limit the set of messages that it displays. For example, you can use the filtering tools to view only the messages that the JDBC subsystem has generated.
To view a server's log messages from the Administration Console, do the following:
Figure 7-2 Right-click the Name of the Server
The right pane of the Administration Console displays the Search Log page. By default, the Search Log page displays up to 500 messages in reverse chronological order. The messages at the top of the window are the most recent messages that the server has generated. If you set up log file rotation, you see only the messages that are in the current log file. For more information, refer to Rotating Log Files.
Figure 7-3 View Message Details
By default, Subsystem, Users, Sub String and Since fields are undefined. If you leave them undefined, then the log viewer returns messages from all subsystems and security contexts since the earliest message in the file was generated.
If you select Ongoing, the Administration Console displays messages as they are generated.
The Administration Console constructs a query that returns the log-message data you request. The query searches in the current log file only. If the log file has been rotated, the query does not search through old messages that have been moved to another file.
None of the items on this page effect the messages that are actually stored in the log file; instead, they determine the log file data that the Administration Console displays.
The Administration Console does not save your filter criteria. The next time you access the Search Log page, the Administration Console uses the default criteria to display messages.
You can use a text editor to view messages in the current log file as well as older log files that the server creates per its log file rotation scheme. A text editor displays all attributes of all messages that are in the log file.
You cannot access the additional message details if you view messages from a text editor. Only the Administration Console log viewer provides access to the message details as described in step 5. in From the Administration Console.
To view log messages from a text editor, do the following:
If the pathname is relative, it is relative to the server's root directory.
For example, if you created a domain in the c:\user_projects\MyDomain directory, and you used the c:\user_projects\MyDomain\startWebLogicServer.cmd script to start the server, then the server's root directory is c:\user_projects\MyDomain. By default, the Server File Name field contains .\MyServer\MyServer.log and the log file is located in c:\user_projects\MyDomain\MyServer\MyServer.log.
If the Server File Name field contains only a filename, the log file is located in the root-directory\server-name directory.
For more information, refer to "A Server's Root Directory."
Depending on your text editor and operating system, you could prevent the server from logging messages while the file is open in the text editor. Any changes to the file's timestamp can confuse log file rotation.
Any log files that the server created to store old log messages are located in the same directory as the current log file.
You can view the domain log from the following applications:
From the Administration Console
You can use the Administration Console to view the domain log file without logging on to the host computer. In addition, the Administration Console's log file viewer provides filtering tools that you can use to limit the set of messages that it displays. For example, you can use the filtering tools to view only the messages that the JDBC subsystem has generated.
To view a domain's log messages from the Administration Console, do the following:
Figure 7-4 Right-click the Domain Name
The right pane of the Administration Console displays the Search Log page. By default, the Search Log page displays up to 500 messages in reverse chronological order. The messages at the top of the window the most recent message the servers have forwarded to the domain log. For more information, refer to Rotating Log Files.
Figure 7-5 View Message Details
By default, Subsystem, Server, Users, Sub String and Since fields are undefined. If you leave them undefined, then the log viewer returns messages from all subsystems, servers, and security contexts since the earliest message in the file was generated.
If you select Ongoing, the Administration Console displays messages as they are generated.
The Administration Console constructs a query that returns the log-message data you request. The query searches in the current domain log file only. If the log file has been rotated, the query does not search through old messages that have been moved to another file.
None of the items on this page effect the messages that are actually stored in the domain log file; instead, they determine the log file data that the Administration Console displays.
The Administration Console does not save your filter criteria. The next time you access the Search Log page, the Administration Console uses the default criteria to displays messages.
You can use a text editor to view messages in the current domain log file as well as older log files that the Administration Server creates per its domain-log file rotation scheme. A text editor displays all attributes of all messages that are in the log file.
You cannot access the additional message details if you view messages from a text editor. Only the Administration Console log viewer provides access to the message details as described in step 5. in From the Administration Console.
To view domain-log messages from a text editor, do the following:
If the pathname is relative, it is relative to the base domain directory, which you specified when you created the domain. This is the same directory that contains the domain's config.xml file.
For example, if you created a domain in the c:\user_projects\MyDomain directory, then the base domain directory is c:\user_projects\MyDomain. By default, the File Name field contains .\wl-domain.log and the log file is located in c:\user_projects\MyDomain\wl-domain.log.
If the File Name field contains only a filename, the log file is located in the domain directory.
By default, local log files and domain log files grow in size indefinitely. You can specify that WebLogic Server renames (rotates) log files periodically. Old messages remain in the renamed log file and new messages accumulate in the new log file.
You can base log file rotation on the size of the log file or on a time interval. You can also specify the maximum number of rotated files that can accumulate. After the number of log files reaches this number, subsequent file rotations overwrite the oldest log file.
To set up log file rotation, do the following:
Figure 7-6 Click on the Name of a Server
At the time that you specify, the server renames the current log file as FileName.n. Thereafter, the server renames the log file at an interval that you specify in File Time Span.
Use the following format: hh:mm, where hh is the hour in a 24-hour format and mm is the minute.
If the time that you specify has already past, then the server starts its file rotation immediately.
Specifying Which Messages a Server Sends to Standard Out
In addition to writing messages to log files, a WebLogic Server instance can print a subset of its messages to standard out. Usually, standard out is the shell (command prompt) in which you are running the server instance. However, some operating systems enable you to redirect standard out to some other location. If you use the Node Manager to start a Managed Server, the Node Manager redirects a server's standard out to a file. For more information, refer to Viewing Standard Out for a Server Started by the Node Manager.
By default, all messages of WARNING severity or higher are printed to standard out and messages of the DEBUG severity are not printed to standard out.
To specify which messages a server sends to standard out, do the following:
WebLogic Server does not generate DEBUG messages, but you can configure an application that you write to do so. For more information, refer to Writing Debug Messages in the Using WebLogic Logging Services Guide.
Viewing Standard Out for a Server Started by the Node Manager
If you use the Node Manager to start a Managed Server, the Node Manager redirects a server's standard out to a file. You can use the Administration Console to view the contents of the file. For information about where this file is located, refer to "Managed Server Log Files."
To view standard out messages for a server that was started by the Node Manager, do the following:
The right pane of the Administration Console displays standard out messages from the most recent (or current) server session.
The following sections describe other tasks related to WebLogic Server log messages:
For more logging tasks, refer to Specifying the Messages that a Server Forwards to the Domain Log.
Redirecting JVM Messages to a File
The JVM within which a WebLogic Server instance runs also can send messages to standard error and standard out. For example, you can pass standard Java startup arguments that cause the JVM to print verbose garbage-collection messages to standard out.
If you use a WebLogic Server script to start a server instance, there is no default, persistent storage for the standard error and standard out messages.
If you want to keep a record of these messages, edit the WebLogic Server script so that the JAVA_OPTIONS variable specifies the following:
-Dweblogic.Stdout="stdout-filename"
-Dweblogic.Stderr="stderr-filename"
Where stdout-filename is the name of a file that you want to save standard out messages and stderr-filename is the name of a file that you want to save standard error messages.
The WebLogic Server instance redirects all standard out and standard error messages to these files. Use a text editor to view the contents of these files. You cannot view them from the Administration Console.
Note: WebLogic Server prompts for entering your username and password are sent to standard out. If you use -Dweblogic.Stdout, you will no longer see the prompts to enter your username and password. To bypass this prompt, use a boot identity file as described in Bypassing the Prompt for Username and Password.
Disabling a Server from Forwarding Messages to the Domain Log
By default, a server instance forwards log messages of an ERROR or higher severity to domain log. To prevent a server from sending messages to the domain log, do the following:
Changing the Name and Location of the Server Log File
By default, the local server log file is named ./SERVER_NAME/SERVER_NAME.log, where SERVER_NAME is the name of the server. The path is relative to the server's root directory.
If you use the Node Manager to start a Managed Server, the server's root directory is located on the computer that hosts the Node Manager. For information about a server's root directory, refer to "A Server's Root Directory" in the Configuring and Managing WebLogic Server guide.
To change the default name or location of a server's local log file, do the following:
Changing the Name and Location of the Domain Log File
The default name for a domain log file is ./DOMAIN_NAME.log, where DOMAIN_NAME is the name of the domain. The path is relative to the root directory of the Administration Server.
To change the default name or location of the domain's log file, do the following:
Figure 7-7 Click on the Name of the Domain
Specifying HTTP Log File Settings for a Server
At the time that you specify, the server renames the current HTTP log file as FileName.n, where FileName is the name of the HTTP log file and n is a sequential number. Thereafter, the server renames the log file at an interval that you specify in Rotation Period. You can create a recurring start time such as "every Monday at 09:00" or a non-recurring start time such as "9 January, 2002, 09:00."
Use the java.text.SimpleDateFormat format to specify a time. To express hours and minutes, use the H:m format. For information about this format, refer to the J2EE Javadoc.
If the date that you specify has already past, then the day in week (E in the SimpleDateFormat), hour in day (H), minute in hour (m) and second in minute (s) are used with the current date to recalculate a start time.