Using Java logging in an application
This topic describes how to use Java™ logging within an application.
About this task
To create an application using Java logging, perform the following steps:
Procedure
- Optional: Create the necessary handler, formatter,
and filter classes if you need your own log files. Note: Use the WebSphere® log and trace infrastructure to make problem source identification simpler, rather than creating separate log files.
- Optional: If localized messages are used by the application, create a resource bundle, as described in Creating log resource bundles and message files.
- In the application code, get a reference to a logger instance, as described in Using a logger.
- Insert the appropriate message and trace logging statements in the application, as described in Using a logger.
次主題
Using a logger
You can use Java logging to log messages and add tracing.Java logging
Java logging is the logging toolkit that is provided by the java.util.logging package. Java logging provides a standard logging API for your applications.Configuring the logger hierarchy
WebSphere Application Server handlers are attached to the Java root logger, which is at the top of the logger hierarchy. As a result, any request from anywhere in the logger tree can be processed by WebSphere Application Server handlers.Creating log resource bundles and message files
You can forward messages that are written to the internal WebSphere Application Server logs to other processes for display. Messages that are displayed on the administrative console, which can be running in a different location than the server process, can be localized using the late binding process. Late binding means that WebSphere Application Server does not localize messages when they are logged, but defers localization to the process that displays the message.Logger.properties file for configuring logger settings
Use the Logger.properties file to set logger attributes for specific loggers.


http://www14.software.ibm.com/webapp/wsbroker/redirect?version=cord&product=was-nd-mp&topic=ttrb_javalogapps
檔名:ttrb_javalogapps.html