| |  |
Home In This Issue Email a Friend EasyPrint
 | |
|
Utilizing the IBM Trace Log in WebSphere Application Server (continued)
Programming considerations using IBM's Trace Logging facilities Since IBM's TrLog is the default implementation of commons logging, you do not need to do anything special to implement trace logging. The simplest method to obtain an instance of com.ibm.ws.commons.logging.TrLog is to use the standard factory method:
Log myLog = LogFactory.getLog("<your-log-name>");
|
Once you have an instance of com.ibm.ws.commons.logging.TrLog, you can use all of the standard logging methods to generate log messages such as:
myLog.debug("<your-debug-level-message-text>");
|
In addition to the standard methods, you can also use the log.trace() method to generate trace-level messages for enhanced problem determination. Trace-level messages can be included in your application to provide a finer-grained level of information than that normally provided by debug- or info-level messages.
Administering Trace Logging output The output of IBM's TrLog facility can be controlled through the WebSphere Administrative Console. To access the console, open up a browser window and enter in the address (URL) of your server's console application. Log into the console and click on the plus sign in front of the "Troubleshooting" menu item, as shown in Figure A.
FIGURE A
Expand the Troubleshooting menu Click picture for a larger image.
This will open up three selections, Logs and Trace, Configuration Problems, and PMI Request Metrics. Click on Logs and Trace. This should take you to the server selection panel, Figure B.
FIGURE B
Select your server. Click picture for a larger image.
Click on the name of your server. This will take you to the logging and tracing options panel, Figure C.
FIGURE C
You're almost there. Click picture for a larger image.
Click on Diagnostic Trace. This will take you to the diagnostic trace configuration panel, Figure D.
FIGURE D
This is where you'll manage your trace output. Click picture for a larger image.
The Diagnostic Trace configuration panel is where you manage the trace output. To adjust the trace output, you can either type in your new values in the Trace Specification text box, or you can click on the Modify button to bring up a wizard that will walk you through your changes, as you can see in Figure E.
FIGURE E
This wizard will walk you through your changes. Click picture for a larger image.
The wizard displays all known WebSphere facilities that utilize trace logging, and in version 5.0, your implementation will appear under the category UNKNOWN (once you have logged at least one message).
You can also change the name of the trace log file in the Trace Output section of the panel. Once you have made your changes, click OK and follow the instructions to save the master configuration.
You can also use the administrative console to view the trace log. Click on the Runtime tab on the configuration panel to access this option, as shown in Figure F.
FIGURE F
Pop into the Runtime tab to make your change. Click picture for a larger image.
In the Trace Output section of the panel, click the View button. This will take you to the trace log view screen that's displayed in Figure G.
[ Prev | Next ]
|
|
-- Advertisement --
Learn Java and WebSphere at Your Place and Pace! FREE Course!
Advance your career and become an IBM Certified developer with TLCC's Java and WebSphere courses. Start by learning to use Java in Domino agents. Then learn to develop servlets and JSPs using IBM's Rational Application Developer 6.
Download the course to your computer and learn at your own place and at your pace! Expert help is a click away.
Click here to try a FREE demo course!! |
|
Copyright © 2008, ZATZ Publishing. All rights reserved worldwide.
|