Oracle Weblogic Logging configuration

Oracle WebLogic logging infrastructure supports a logger on each server that collects the log events generated by the application server. By default logs are sent to three destinations:

  • Log File: configures messages sent to the Server Log file. 
  • Console: configures messages sent to the Console.
  • Log Broadcaster: configures messages sent to the Log Domain broadcaster.

 

 

The following picture depicts the how logs are sent and collected from the various components of an Oracle WLS Domain:

oracle weblogic book oracle weblogic books what is weblogic

By default, the Server log file is located in the logs directory below the server instance root; for example, DOMAIN_NAME\servers\SERVER_NAME\logs\SERVER_NAME.log. So, for example, the log file for the Admin Server, part of the base_domain will be:

C:\Weblogic\user_projects\domains\base_domain\servers\AdminServer\logs\AdminServer.log

In addition to writing messages to the server log file, each server instance prints logs messages to its console and broadcasts a subset of its messages to a domain-wide log file. By default, servers forward only messages of severity level NOTICE or higher.

The Domain log file provides a central location from where you can view the overall status of the domain; this file resides in the Administration Server logs directory. The default name and location for the domain log file is DOMAIN_NAME\servers\ADMIN_SERVER_NAME\logs\DOMAIN_NAME.log.

General Server Logging configuration

The server log file records information about events such as the startup and shutdown of servers or the deployment of new applications. 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 configure Server Logging for the individual servers as follows:

1.       Navigate into the console and select Environment | Servers option. From the Server view, choose the Logging Tab.

2.       Select the General lower tab to configure the generic logging properties as follows:

oracle weblogic book oracle weblogic books  what is weblogic

At the bottom of the screen, you can further expand Logging configuration by entering in the “Advanced” Tab which is discussed in the following section.

Advanced Weblogic Server Logging configuration

You can configure the Log severity levels in the Advanced tab of the Logging screen. The Combo Box “Minimum severity to log” configures the minimum severity of log messages going to all log destinations, as indicated by the following picture:

oracle weblogic book oracle weblogic books what is weblogic

The Severity level gives a rough guide to the urgency of a log message. WebLogic Server has predefined severities, ranging from TRACE to EMERGENCY, which are converted to a log level when dispatching a log request to the logger. A log level object can specify any of the following values, from lowest to highest impact: TRACE, DEBUG, INFO, NOTICE, WARNING, ERROR, CRITICAL, ALERT, EMERGENCY

By default, all server messages are published. Increase the Minimum severity log in order to reduce the verbosity of your server logs. In addition, in the Advanced Logging screen you can fine tune the Logging configuration for some specific destinations (Log File, Log Console, Log Broadcaster) as shown by the following picture:

oracle weblogic book oracle weblogic books what is weblogic 

How to redirect JVM logs to the Weblogic logging system

The JVM used to start WLS produces standard output logs (think for example of System.out contained in the code) or even standard errors. This can lead to a plethora of information spread in many different points. You can, however, mitigate this issue by directing all these standard out / error logs to the Weblogic logging system; you can achieve this by simply flagging the “Redirect stdout logging enabled” and “Redirect stderr logging enabled” from the Advanced Logging configuration.

Francesco Google+