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...

Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

i dont think application servers provide you the default configuration log4j.xml.

its the log4j framework which provides you the xml.
if u r using log4j for logging then u will have to come up with your own configuration file and name it as log4j.xml

you will get lot of guideance here


Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
dmoreAuthor Commented:
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?
dmoreAuthor Commented:
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
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Java App Servers

From novice to tech pro — start learning today.