7.2.  Use trace facility (e.g., enabling, selecting components, and log configuration).

[Note]

Changing the logging and tracing options

You might want to customize the logging and tracing properties for the new application server. There are several ways to access the logging and tracing properties for an application server.

We will take the third navigation path to customize the location of the JVM logs, the diagnostic trace logs, and the process logs.

  1. Select Logging and Tracing.

  2. Select JVM Logs.

    This allows you to change the JVM standard output and error file properties. Both are rotating files. You can choose to save the current file and create a new one, either when it reaches a certain size, or at a specific moment during the day. You can also choose to disable the output of calls to System.out.print() or System.err.print().

    Figure 7.2. JVM Logs

    JVM Logs


    We recommend that you specify a new file name, using an environment variable to specify it, such as:

    ${APPLICATION_ROOT}/logs/SystemOut.log

    ${APPLICATION_ROOT}/logs/SystemErr.log

    On this page you can also modify how WebSphere will rotate your log files.

    Click OK.

  3. Select Diagnostic Trace.

    Each component of the WebSphere Application Server is enabled for tracing with the JRas interface. This trace can be changed dynamically while the process is running using the Runtime tab, or added to the application server definition from the Configuration tab. As shown in figure below, the trace output can be either directed to memory or to a rotating trace file.

    Change the trace output file name so the trace is stored in a specific location for the server using the ITSOBANK_ROOT variable and select the Log Analyzer format.

    Figure 7.3. Specifying diagnostic trace service options

    Specifying diagnostic trace service options


    Click OK.

  4. Select Process Logs.

    Messages written by native code (JNI) to standard out and standard error streams are redirected by WebSphere to process logs, usually called native_stdout.log and native_stderr.log. Change the native process logs to:

    ${APPLICATION_ROOT}/logs/native_stdout.log

    ${APPLICATION_ROOT}/logs/native_stderr.log

    Click OK.

  5. All log files produced by the application server are now redirected to the ${APPLICATION_ROOT}/logs directory. Save the configuration.

Log levels

Levels control which events are processed by Java logging. WebSphere Application Server controls the levels of all loggers in the system.

The level value is set from configuration data when the logger is created and can be changed at run time from the administrative console. If a level is not set in the configuration data, a level is obtained by proceeding up the hierarchy until a parent with a level value is found. You can also set a level for each handler to indicate which events are published to an output device. When you change the level for a logger in the administrative console, the change is propagated to the children of the logger.

Levels are cumulative; a logger can process logged objects at the level that is set for the logger, and at all levels above the set level.

Valid log levels:

NOTE: Trace information, which includes events at the Fine, Finer and Finest levels, can be written only to the trace log. Therefore, if you do not enable diagnostic trace, setting the log detail level to Fine, Finer, or Finest does NOT effect the logged data.

Professional hosting         Free 'Oracle Certified Expert Web Services Developer 6' Guide     Free SCDJWS 5.0 Guide