Posted on 2006-04-13
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
    LVL 6

    Accepted Solution

    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

    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
    LVL 6

    Expert Comment

    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

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

    Thanks for your advice.Iam now facing a different issue.I have have servlet which starts up automatically when websphere calls another EJB in which I have put some 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

    Do You Know the 4 Main Threat Actor Types?

    Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

    Join & Write a Comment

    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…
    Upgrading Tomcat – There are a couple of methods to upgrade Tomcat is to use The Apache Installer is to download and unzip and run the services.bat remove|install Tomcat6 Because of the App that we are working with, we can only use Tomcat 6.…
    Sending a Secure fax is easy with eFax Corporate ( First, Just open a new email message.  In the To field, type your recipient's fax number You can even send a secure international fax — just include t…
    This video discusses moving either the default database or any database to a new volume.

    734 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

    Need Help in Real-Time?

    Connect with top rated Experts

    23 Experts available now in Live!

    Get 1:1 Help Now