wood burning stoves 2.0*
The moose likes Websphere and the fly likes log4j in WebSphere5.1 Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Products » Websphere
Bookmark "log4j in WebSphere5.1" Watch "log4j in WebSphere5.1" New topic
Author

log4j in WebSphere5.1

Sam De Albin
Greenhorn

Joined: May 10, 2004
Posts: 3
hi all

Does anybody know , how to configure log4j in websphere 5.1?? First, I developed my application for weblogic 7.1. then i ported to websphere 5.1. log4j was working fine in weblogic. But, in websphere everything is fine except log4j. Do i need to add any special entries in server specific xml files???

plz help me......

Sam
Chris Mathews
Ranch Hand

Joined: Jul 18, 2001
Posts: 2712
Moving to the IBM/Websphere Forum...
Jeanne Boyarsky
internet detective
Marshal

Joined: May 26, 2003
Posts: 30076
    
149

Sam,
What error are you getting?


[Blog] [JavaRanch FAQ] [How To Ask Questions The Smart Way] [Book Promos]
Blogging on Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, OCAJP, OCPJP beta, TOGAF part 1 and part 2
Scott Duncan
Ranch Hand

Joined: Nov 01, 2002
Posts: 363
I set up log4j in WebSphere just like anywhere else, I'd imagine. Create a servlet with init method:

public void init()
{
String prefix = getServletContext().getRealPath("/");
String file = getInitParameter("log4j_conf");
if (file != null)
{
PropertyConfigurator.configure(prefix + file);
}

}

and then in the web.xml file make sure load-on-startup is set to 1 and the log4j_conf init param value is set to the path to the log4j_conf.properties file. No worries...


No more rhymes! I mean it!<br /> <br />Does anybody want a peanut?
Sam De Albin
Greenhorn

Joined: May 10, 2004
Posts: 3
hi

i doesnt get any error!! in the log4j.properties file , I mentioned the file name of the logger. But, that file is not at all there when I run the pgm. Should I create a blank file before starting the Application???

Sam.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: log4j in WebSphere5.1
 
Similar Threads
Tuning Thread pool size
Websphere Deployment Issue (Hibernate and Oracle)
EJB Server for Windows 98
error while Uploading file
I know Weblogic - want to learn Webshere. Help needed.