Configuring Java logging using the administrative console

Java™ logging provides a standard logging API for your applications. Before applications can log diagnostic information, you need to specify how you want the server to handle log output and what level of logging you require.

About this task

Developing, deploying and maintaining applications are complex tasks. When an application encounters an unexpected condition, it might not be able to complete a requested operation. You might want the application to inform the administrator that the operation failed and tell the administrator why the operation failed. This information enables the administrator to take the proper corrective action. Application developers might need to gather detailed information that relates to the path of a running application to determine the root cause of a failure that is due to a code bug. The facilities that are used for these purposes are typically referred to as logging and tracing. For more information read Java logging.

Using the administrative console, you can:
  • Enable or disable a particular log, specify where log files are stored and how many log files are kept.
  • Specify the level of detail in a log, and specify a format for log output.
  • Set a log level for each logger.

You can change the log configuration statically or dynamically. Static configuration changes affect applications when you start or restart the application server. Dynamic or run time configuration changes apply immediately.

When a log is created, the level value for that log is set from the configuration data. If no configuration data is available for a particular log name, the level for that log is obtained from the parent of the log. If no configuration data exists for the parent log, the parent of that log is checked, and so on up the tree, until a log with a non-null level value is found. When you change the level of a log, the change is propagated to the children of the log, which recursively propagates the change to their children, as necessary.

Procedure

  1. Optional: See the Java documentation for the java.util.logging class for a full description of the syntax and the construction of logging methods.
  2. Set the logging levels for your logs:
    1. In the navigation pane, click Servers > Application Servers.
    2. Click the name of the server that you want to work with.
    3. Under Troubleshooting, click Logs and Trace.
    4. Click Change Log Detail levels.
    5. To make a static change to the configuration, click the Configuration tab. A list of well-known components, packages, and groups is displayed. To change the configuration dynamically, click the Runtime tab. The list of components, packages, and groups displays all the components that are currently registered on the running server.
    6. Select a component, package, or group to set a logging level.
    7. Click Apply.
    8. Click OK.
  3. To have static configuration changes take effect, stop then restart the application server.



In this information ...


IBM Redbooks, demos, education, and more

(Index)

Use IBM Suggests to retrieve related content from ibm.com and beyond, identified for your convenience.

This feature requires Internet access.

Task topic    

Terms of Use | Feedback

Last updated: Oct 20, 2010 11:50:58 PM CDT
http://www14.software.ibm.com/webapp/wsbroker/redirect?version=compass&product=was-base-iseries&topic=ttrb_configjavalog
File name: ttrb_configjavalog.html