Learn how to a build a cloud-first strategyRegister Now



Posted on 2006-04-13
Medium Priority
Last Modified: 2013-12-10
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...

Question by:dmore
  • 2
  • 2

Accepted Solution

avinthm earned 120 total points
ID: 16451635
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


Author Comment

ID: 16472509
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

Expert Comment

ID: 16474930
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.
LVL 10

Expert Comment

ID: 16515981
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?

Author Comment

ID: 16562789
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

Featured Post

Vote for the Most Valuable Expert

It’s time to recognize experts that go above and beyond with helpful solutions and engagement on site. Choose from the top experts in the Hall of Fame or on the right rail of your favorite topic page. Look for the blue “Nominate” button on their profile to vote.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

-Xmx and -Xms are the two JVM options often used to tune JVM heap size.   Here are some common mistakes made when using them:   Assume BigApp is a java class file for the below examples. 1.         Missing m, M, g or G at the end …
Most of the developers using Tomcat find it easy to configure the datasource in Server.xml and use the JNDI name in the code to get the connection.  So the default connection pool using DBCP (or any other framework) is made available and the life go…
This Micro Tutorial will teach you how to add a cinematic look to any film or video out there. There are very few simple steps that you will follow to do so. This will be demonstrated using Adobe Premiere Pro CS6.
Is your data getting by on basic protection measures? In today’s climate of debilitating malware and ransomware—like WannaCry—that may not be enough. You need to establish more than basics, like a recovery plan that protects both data and endpoints.…
Suggested Courses
Course of the Month21 days, 3 hours left to enroll

810 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question