bea.com | products | dev2dev | support | askBEA
 Download Docs   Site Map   Glossary 
Search

Administration Console Online Help

 Previous Next Contents Index  

Logging

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:

Message Attributes

The messages for all subsystems contain a consistent set of fields (attributes) as described in the following table.


 

Table 7-1

Attribute

Description

Timestamp

The time and date when the message originated, in a format that is specific to the locale.

Severity

Indicates the degree of impact or seriousness of the event reported by the message. For more information, refer to Message Severity.

Subsystem

Indicates the subsystem of WebLogic Server that was the source of the message. For example, EJB, RMI, JMS.

Server Name
Machine Name
Thread ID

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.

User ID

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.

Transaction ID

Present only for messages logged within the context of a transaction.

Message ID

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-.

Message Text

A description of the event or condition.


 

Message Severity

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.


 

Table 7-2

Severity

Meaning

INFO

Used for reporting normal operations.

WARNING

A suspicious operation or configuration has occurred but it may not have an impact on normal operation.

ERROR

A user error has occurred. The system or application is able to handle the error with no interruption, and limited degradation, of service.

NOTICE

An INFO or WARNING-level message that is particularly important for monitoring the server.

CRITICAL

A system or service error has occurred. The system is able to recover but there might be a momentary loss, or permanent degradation, of service.

ALERT

A particular service is in an unusable state while other parts of the system continue to function. Automatic recovery is not possible; the immediate attention of the administrator is needed to resolve the problem.

EMERGENCY

The server is in an unusable state. This severity indicates a severe system failure or panic.


 

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.

Message Output

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.

Additional Log Files

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:

 


Viewing Server Logs

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:

  1. Start the server if it isn't already running.
  2. In the left pane of the Administration Console, expand the Servers folder.
  3. Right-click the server whose log you want to view. (See Figure 7-2.)

    Figure 7-2 Right-click the Name of the Server


     

  4. From the popup menu, click View Server Log.

    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.

  5. To view additional information about a message, such as the probable cause and any action you can take to remedy an error, in the Message ID column, click the message ID.(See Figure 7-5.)

    Figure 7-3 View Message Details


     

    A popup window displays details about the message.

  6. To filter the list of messages, click Customize this view, which is located at the top of the Search Log page.
  7. On the customize page, select filtering criteria.

    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.

  8. Click Apply.

    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.

From a Text Editor

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:

  1. To determine the location of the server's log file, do the following:
    1. In the left pane of the Administration Server, expand the Servers folder.
    2. Click the name of a server.
    3. In the right pane, click the Logging tab.
    4. On the Server subtab, note the value in the Server File Name field.
    5. 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."

  2. Log on to the computer that hosts the server instance and change to the directory that contains the log file.
  3. Do not open the log file that the server is using to store current messages. Instead, create a copy of the log file and open the copy in the text editor.

    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.

 


Viewing the Domain Log

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:

  1. In the left pane of the Administration Console, right-click on the name of the domain. (See Figure 7-4.)

    Figure 7-4 Right-click the Domain Name


     

  2. From the popup menu, click View Domain Log.

    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.

  3. To view additional information about a message, such as the probable cause and any action you can take to remedy an error, in the Message ID column, click the message ID. (See Figure 7-5.)

    Figure 7-5 View Message Details


     

    A popup window displays details about the message.

  4. To filter the list of messages, click Customize this view, which is located at the top of the Search Log page.
  5. On the customize page, select filtering criteria.

    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.

  6. Click Apply.

    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.

From a Text Editor

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:

  1. To determine the location of the domain's log file, do the following:
    1. In the left pane of the Administration Server, click the domain.
    2. In the right pane, click the Configuration tab. Then click the Logging subtab.
    3. On the Logging subtab, note the value in the File Name field.
    4. 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.

  2. Log on to the computer that hosts the Administration Server and change to the directory that contains the domain log file.
  3. Do not open the log file that the Administration Server is using to store current domain-wide messages. 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. Instead, create a copy of the log file and open the copy in the text editor.

    Any log files that were created to store old log messages are located in the same directory as the current log file.

 


Rotating Log Files

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:

  1. To specify log file rotation for a server log, do the following from the Administration Console:
    1. In the left pane, expand the Server folder and click on the name of a server. (See Figure 7-6.)
    2. Figure 7-6 Click on the Name of a Server


       

    3. In the right pane, select the Logging tab. Then select the Server tab.

    To specify log file rotation for the domain log, do the following:

    1. In the left pane, click the Domain.
    2. In the right pane, click the Logging tab.
  2. If you want all log messages to accumulate in a single file, in Rotation Type, choose None. You must erase the contents of the file when the size is unwieldy.
  3. If you want to move old messages to another file when the current log file reaches a specific size, do the following:
    1. In Rotation Type, choose By Size.
    2. In File Min Size, enter the maximum file size for a log file (in kilobytes). When the log file reaches this size, the server renames the file as FileName.n, where FileName is the name of the domain log file and n is a sequential number. After the server renames a file, subsequent messages accumulate in a new file named FileName.
    3. If you want to limit the number of log files that the server creates to store old log messages, select Number of Files Limited. Then in File Count, enter the maximum number of files. If the server receives additional domain log messages after reaching the capacity of the last log file, it overwrites the oldest log file.
    4. Click Apply.
  4. If you want to move old messages to another file at specific time intervals, do the following:
    1. In Rotation Type, choose By Time.
    2. In Rotation Time, enter the start time.
    3. 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.

    4. In File Time Span, enter the interval at which the server saves old messages to another file.
    5. If you want to limit the number of log files that the server creates, select Number of Files Limited. Then in File Count, enter the maximum number of log files. If the server reaches this maximum during the current time-rotation sequence, it overwrites the oldest log file when the next interval expires.
    6. Click Apply.

 


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:

  1. In the left pane of the Administration Console, expand the Servers folder.
  2. Click on the name of a server. (See Figure 7-6.)
  3. In the right pane, click the following tabs: Configuration —>Logging —>Server.
  4. Click the Log to Stdout checkbox to place a checkmark there.
  5. If you want to send any messages of DEBUG severity that your application generates to standard out, click the Debug to Stdout to place a checkmark there.

    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.

  6. In Stdout severity threshold, choose the minimum severity level of the messages that you want to send to standard out. For information about message severity, refer to Message Severity.
  7. Click Apply to save the settings.

 


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:

  1. If it is not already running, start the Node Manager on the computer that hosts the server.
  2. In the left pane of the Administration Console, expand the Servers folder.
  3. Click on the name of a server. (See Figure 7-6.)
  4. In the right pane, click the Control tab. Then click the Remote Start Output tab.
  5. On the Remote Start Output tab, click the View Server output link.

The right pane of the Administration Console displays standard out messages from the most recent (or current) server session.

 


Other Logging Tasks

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:

  1. In the left pane of the Administration Console, expand the Servers folder.
  2. Click on the name of a server. (See Figure 7-6.)
  3. In the right pane, click the Logging tab. Then click the Domain tab.
  4. Click on the Log to Domain Logfile checkbox to remove the checkmark.
  5. Click Apply.

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:

  1. In the left pane of the Administration Console, expand the Servers folder.
  2. Click on the name of a server. (See Figure 7-6.)
  3. In the right pane, click the following tabs: Configuration —>Logging—>Server.
  4. In the File Name box, enter a path and filename for the server log. You can enter an absolute pathname or a pathname that is relative to the server's root directory. If you use the Node Manager to start a Managed Server, the root directory is located on the computer that hosts the Node Manager process. For more information, refer to "A Server's Root Directory."
  5. Click Apply to apply your changes.
  6. Restart the server.

    The server writes all subsequent domain messages to the new file.

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:

  1. In the left pane of the Administration Console, click on the name of the domain. (See Figure 7-7.)

    Figure 7-7 Click on the Name of the Domain


     

  2. In the right pane, click the Configuration tab. Then click the Logging tab.
  3. In the File Name box, enter a path and filename for the domain log. You can enter an absolute pathname or a pathname that is relative to the root directory of the Administration Server. For more information, refer to "A Server's Root Directory."
  4. Click Apply to apply your changes.

    Restart the Administration Server. The Administration Server writes all subsequent domain messages to the new file.

Enabling JDBC Logging

  1. Click the Server node in the left pane.
  2. Select a specific server in the left pane. (See Figure 7-6.)
  3. Select the Logging tab.
  4. Select the JDBC tab.
  5. Select Enable JDBC Logging.
  6. Enter a log file name.
  7. Click Apply to save the settings.

Specifying HTTP Log File Settings for a Server

  1. Click the Server node in the left pane. Then select a specific server in the left pane. (See Figure 7-6.)
  2. Select the Logging tab.
  3. On the HTTP tab, click Enable Logging to activate or deactivate HTTP logging. (If Enable Logging is checked, the HTTP logging will be activated.)
  4. If you have enabled HTTP logging, you can modify the default log-file name. HTTP requests are kept in a log file that is separate from the server log file.
  5. Determine the format of the HTTP log file by selecting Common or Extended from the Format list.
  6. To determine the frequency with which the server empties its HTTP-request buffer and writes the data to the HTTP log file, do the following:
    1. In Log Buffer Size, specify the maximum size (in kilobytes) of the HTTP-request buffer.
    2. In the Flush Every parameter, specify the interval (in seconds) at which the server checks the size of the HTTP-request buffer. If the buffer has reached the maximum size, the server writes the data to the HTTP log file.
  7. If you want the server to move old HTTP requests to another file when the current HTTP log file reaches a specific size, do the following:
    1. In Rotation Type, choose size.
    2. In Max Log File SizeK Bytes, enter the maximum file size for a log file (in kilobytes). When the log file reaches this size, the server renames the file as FileName.n, where FileName is the name of the HTTP log file and n is a sequential number. After the server renames a file, subsequent messages accumulate in a new file named FileName.
    3. Click Apply.
  8. If you want the server to create another file at specific time intervals, do the following:
    1. In Rotation Type, choose date.
    2. In Rotation Time, enter the start time.
    3. 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.

    4. In Rotation Period, enter the interval (in minutes) at which the server saves old messages to another file.
    5. Click Apply.

 

Back to Top Previous Next