Category: Websphere Gene De Lisa @ 5:24 pm —
1 Star2 Stars3 Stars4 Stars5 Stars (No Ratings Yet)
Loading ... Loading ...

Server configuration

WSAD already has an implementation of commons-logging that uses JRas as the implementation instead of log4j. This is in the server classpath which is loaded before your applications. So if you want to use log4j instead you have to change the server classpath.

  • Open the Server Perspective.
  • Double click on your server in the Outline view in the lower left corner (it’s named WebSphere v5.0 Test Environment). This will bring up an Editor View.
  • Choose the Applications tab.
  • Select your application and open the tree to the web application and set the Classloader mode to PARENT_LAST.
  • Select the application and set its mode to PARENT_LAST also.
  • Type control-s to save.
  • You have to restart the server for this to take effect.

websphere logging

The properties files in your Web project are now loaded before the parent classloader which loads the system classes. If you don’t do this your properties files are ignored.

Log files

So where are the log files? You can use an absolute path to a project directory. Then after running select the project directory in J2EE Navigator and press “Refresh”. The relative file names you specify in log4j.properties are relative to c:\Program Files\IBM\WebSphere Studio (or wherever you installed studio). There is already a logs directory there so perhaps in log4j.properties you should set your files like this:


log4j.appender.x=org.apache.log4j.FileAppender
log4j.appender.x.File=logs/onlinestore.log.txt

#or an absolute path:
log4j.appender.x.File=c:/j2eefasttrack-workspace/OnlineStore/log.txt

Sorry, no comments yet.

Write Your Comment

Comment Guidelines: Basic XHTML is allowed (a href, strong, em, code). All line breaks and paragraphs will be generated automatically.

You should have a name, right? 
Your email address, I promised I won't tell it to anyone. 
If you have a web site or blog, you can type the URL right here. 
This is where you type your comments. 
Remember my information for the next time I visit.