Link to home
Start Free TrialLog in
Avatar of dmore
dmore

asked on

log4j

Hi Friends
can anyone of you please advice if websphere uses any default log4j configuration file for appenders like jboss has log4j.xml .it is urgent...

Thanks..
ASKER CERTIFIED SOLUTION
Avatar of avinthm
avinthm

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of dmore
dmore

ASKER

Hi avinthm
JBOSS provides us with its own log4j.xml so wanted to know if websphere has something similar.Do you mean to say that websphere app server does' nt provide one
I am not sure about JBoss. But atleast Websphere doesnt provide anything like that (i mean log4j.xml)

When u develop your application, you will have to come up with ur configuration.
Package the whole application , including config xml files etc etc, into an war or ear.
Then deploy it in WAS (websphere app server).

This is the way u got to work on WAS.
Out of the box, depending on your version of Websphere, it uses java.util.logging (J2SE standard JSR 47) through a Jakarta Commons-Logging wrapper, or (now deprecated) JRas.

You can switch the Commons-Logging wrapper to use log4j instead of java.util.logging (set in commons-logging.properties), but you might need to add the log4j jar file and config file yourself.  There can be special issues for clustered servers or for particular operating systems (z/OS, i5/OS).

There are also different options for using the commons-logging provided by WAS, bundling it with your application, or bundling it with your application configuration.

If you are familiar with log4j, note that java.util.logging uses similar concepts with different names

log4j  --> java.util.logging
--------------------------------
appender --> handler
layout  -->  fomatter
LoggingEvent --> LogRecord

So a few questions:  What version of Websphere?  On what platform?  What are you trying to accomplish?
Avatar of dmore

ASKER

friends,
Thanks for your advice.Iam now facing a different issue.I have have servlet which starts up automatically when websphere starts.it calls another EJB in which I have put some logger.info and logger.debug statements.The EJB does it functionality but does not write these statments to the log.Obviously it looks like the logger was not initialised at that stage.Any ideas how I can print these.

I have increased the points to 30 .Thanx