Log4j JSP Warning Message

Posted on 2011-05-12
Last Modified: 2012-06-27
I'm using log4j in my Tomcat 5.5 web app.  I need to do basic logging.

Attached is the file I placed in WEB-INF directory.  Logging works fine in catalina.out.

Problem is that when I redeploy the web app to Tomcat, I get the following message in catalina.out

log4j:WARN No appenders could be found for logger (org.apache.commons.digester.Digester.sax)
log4j:WARN Please initialize the log4j system properly.

Should I ignore this warning?  Am I missing something?
# Set root logger level to DEBUG and its only appender to A1.
log4j.rootLogger=DEBUG, A1

# A1 is set to be a ConsoleAppender.

# A1 uses PatternLayout.
log4j.appender.A1.layout.ConversionPattern=%-4r [%t] %-5p %c %x - %m%n

Open in new window

String __jspName = this.getClass().getSimpleName().replaceAll("_", ".");

Logger log = Logger.getLogger(this.getClass().getName());"BEGIN JSP "+__jspName);

Open in new window

Question by:lcor
    LVL 47

    Expert Comment

    LVL 47

    Accepted Solution

    I think your file should be in

    Is it places in there?
    LVL 47

    Expert Comment

    LVL 47

    Expert Comment

    Even though the last link did not have accepted by the asker solution
    there are some possibly reasonable suggestions:

    In particular in the lst trail there is suggestuion to add this to

    question about adding appender
    I can't see that you add the appender to the logger?

    and also suggestion not to use properties at all like that:
    static Logger               eventLogger         = Logger.getLogger("MyPackage.Eventlogger");

    ConsoleAppender m_EventConsoleAppender  = new ConsoleAppender(new PatternLayout("[%d] %-5p - %m%n"), ConsoleAppender.SYSTEM_OUT);


    LVL 92

    Assisted Solution

    > Attached is the file I placed in WEB-INF directory.  Logging works fine in catalina.out.

    the warning is because it cannot find
    it should be in WEB-INF/classes

    Featured Post

    Top 6 Sources for Identifying Threat Actor TTPs

    Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

    Join & Write a Comment

    Suggested Solutions

    This was posted to the Netbeans forum a Feb, 2010 and I also sent it to Verisign. Who didn't help much in my struggles to get my application signed. ------------------------- Start The idea here is to target your cell phones with the correct…
    Introduction This article is the last of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article covers our test design approach and then goes through a simple test case example, how …
    Video by: Michael
    Viewers learn about how to reduce the potential repetitiveness of coding in main by developing methods to perform specific tasks for their program. Additionally, objects are introduced for the purpose of learning how to call methods in Java. Define …
    This tutorial will introduce the viewer to VisualVM for the Java platform application. This video explains an example program and covers the Overview, Monitor, and Heap Dump tabs.

    732 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

    24 Experts available now in Live!

    Get 1:1 Help Now