Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9204281
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T23:40:30+00:00 2026-06-17T23:40:30+00:00

I have a Spring webapp packaged as a WAR file being deployed to Tomcat.

  • 0

I have a Spring webapp packaged as a WAR file being deployed to Tomcat.

Catalina.out shows

log4j:WARN No appenders could be found for logger (org.springframework.web.context.ContextLoader).
log4j:WARN Please initialize the log4j system properly.
log4j:WARN See http://logging.apache.org/log4j/1.2/faq.html#noconfig for more info.
gen 29, 2013 11:37:04 AM org.apache.catalina.core.StandardContext startInternal
SEVERE: Error listenerStart

That’s probably a configuration error in either Spring or Hibernate. But in order to find the cause of listenerStart error I think it’s necessary to enable log4j. Googling around I found that the log4j warning is caused by missing log4j configuration, and that’s certain because I haven’t configured it yet.

How do I configure log4j (where do I put the configuration file and what do I type in) in order to log errors to catalina.out, which is the most reasonable place for development logging?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-17T23:40:32+00:00Added an answer on June 17, 2026 at 11:40 pm

    Create a log4j.xml file like this one

    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE log4j:configuration SYSTEM "log4j.dtd">
    <log4j:configuration xmlns:log4j="http://jakarta.apache.org/log4j/">
        <appender class="org.apache.log4j.ConsoleAppender" name="CONSOLE">
            <param value="INFO" name="Threshold"/>
            <layout class="org.apache.log4j.PatternLayout">
                <param value="%d{DATE}\t%m%n" name="ConversionPattern"/>
            </layout>
        </appender>
        <!-- Here you create additional logger for your application, ie:
        <logger name="package.xxx">
             <level value="info" />
        </logger>
        -->
        <logger name="rootLogger">
            <level value="info"/>
            <appender-ref ref="CONSOLE"/>
        </logger>
    </log4j:configuration>
    

    The basic explanation of this configuration file is

    1. appender: you can define multiple appender, the one I set up for you is called CONSOLE and is a ConsoleAppender, which means it writes on the standard output (in a tomcat environment, catalina.out).
    2. layout is the definition of the layout of your log file, take a look to PatternLayout to understand the meaning of what I wrote and to modify to your needs
    3. logger, where you define one or more logger for your application. Here I simply define a rootLogger with default level info and which is going to use the CONSOLE appender.

    Place this file wherever in your classpath and you will have your log4j configured. For a full tutorial, you can refer to http://logging.apache.org/log4j/1.2/manual.html

    EDIT I read over your question again, I suggest you to add a second logger to log spring stuff like

    <logger name="org.springframework">
        <level value="info"/>
    </logger>
    

    where you just set the level to the fine grained you desire for Spring message. The full tutorial will explain levels quite clearly, but in short the higher the level the less verbose is going to be your log.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

We have a Tapestry-Spring-Hibernate webapp running on Tomcat 6, handing about a few 1000
I have deployed an ejb in a war file(not an ear file). I have
I have Apache2 SSL which is fronting Spring webapp as follows: ProxyPass / http://localhost:8080/
During development I frequently have to deploy a large war-file (~45 MB) to a
I have a new web app that is packaged as a WAR as part
I have Spring project. I ran it before under tomcat and weblogic and I
I have a Spring based webapp. I am using several repository classes with annotations
I have a Spring-based webapp and my problem is after a change in my
In each controller I have in my Spring MVC webapp, there's this line: static
I have guvnor deployed on tomcat 7. Now need to deploy a wrapper webservice

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.