If you develop on WebSphere Application Server (WAS) using Rational Application Developer (RAD), you likely use the handy server integration features which allow you to “publish” modules directly to the appserver without having to leave the IDE. One feature of this integration is that the eclipse console view displays the WebSphere SystemOut.log file so the developer can view log statements, again without leaving the IDE.
One problem with this integration as I see is that this log file only displays logging at the INFO level and above. Meaning, most often a developer server usage is a single user (themselves) analyzing application logging that probably should be trace level – that is, logging that should never see the light of day in a multi-user production environment but is immensely helpful in tracing the flow of data through the classes and methods of an application.
WebSphere Application Server does provide the capability of changing the logging level by logger name or package at runtime, but reducing the level for a given set of loggers to FINE, FINEST, or ALL results in trace logging going to a separate log file. By default, this file is trace.log.
This default presents the problem for RAD users: the eclipse console doesn’t display the trace.log file. Meaning, a developer can add trace statements the right way in their code – log.debug() in Apache Commons-Log or log.fine/finest() with java.util.logging – yet not see these log statements in the IDE. I have found this often causes developers who prefer the IDE’s console to begin the bad practice of intensive logging with the INFO level so they can “see” the log statements in development. This leads to unhappy server admins, let me tell you!
Here is how you can redirect WAS trace logs to SystemOut.log in a development WebSphere Application Server instance and view trace logging in the RAD/eclipse console. It’s surprisingly simple and I only stumbled across this behavior by accident one day. My whole team uses it, and it works (we use WAS v7) for us.
First, log into your WAS admin console. Locate the Logs and Trace section.
Next, if applicable, select the server/profile you have integrated with RAD. In my screenshot, the WAS profile is for a WebSphere Portal (v6.1.5) instance, but it shouldn’t matter.
First, we need to find where WAS is writing its SystemOut.log file which RAD displays in a console view. Take note (copy into the clipboard) of the file path, including any variables:
Next, go back to the server logs pane and choose Diagnostic Trace.
In the Diagnostic Trace settings, note the current file path. You may want to save a note with the original location or choose to backup your entire WAS profile config files as a safety precaution.
Change the value of the trace log to the value of the path to SystemOut log.
Click the Save button at the bottom of the page, then save these config changes to the master repository:
You should now be able to see application trace logs in your RAD console for your integrated WebSphere Application Server profile:
Feel free to add your own notes, comments, feedback in the comments section below. I’m curious as to how other teams utilize their RAD/WebSphere integration.
Happy Coding,
Scott


















