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

  • Home
  • SEARCH
  • 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 62975
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 10, 20262026-05-10T18:33:36+00:00 2026-05-10T18:33:36+00:00

I have a problem wih a logging setup in a apring webapp deployed under

  • 0

I have a problem wih a logging setup in a apring webapp deployed under tomcat 6.

The webapp uses the commons-logging api, on runtime log4j should be used. The log file is created but remains empty – no log entries occur.

the setup is the following:

WEB-INF/web.xml:

 <context-param>     <param-name>log4jConfigLocation</param-name>     <param-value>/WEB-INF/log4j.xml</param-value>   </context-param>   <listener>     <listener-class>org.springframework.web.util.Log4jConfigListener</listener-class>   </listener> 

WEB-INF/classes/commons-logging.properties:

org.apache.commons.logging.Log=org.apache.commons.logging.impl.Log4JLogger 

WEB-INF/log4j.xml:

<log4j:configuration xmlns:log4j='http://jakarta.apache.org/log4j/'>    <appender name='CONSOLE' class='org.apache.log4j.ConsoleAppender'>     ...   </appender>   <appender name='FILE' class='org.apache.log4j.RollingFileAppender'>     <param name='File' value='${catalina.home}/logs/my.log'/>     ...   </appender>    <logger name='my.package'>     <level value='INFO'/>   </logger>    <root>     <level value='ERROR'/>     <appender-ref ref='CONSOLE'/>     <appender-ref ref='FILE'/>   </root> </log4j:configuration> 

The file logs/my.log is created, but no logs appear. The are info logs on the tomcat console, but not with the layout pattern configured.

The commons-logging-1.1.1.jar and log4j-1.2.14.jar are included in WEB-INF/lib. Any idea what is wrong here?

  • 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. 2026-05-10T18:33:37+00:00Added an answer on May 10, 2026 at 6:33 pm

    There are numerous documented instances on the web warning people about the use of commons-logging. So much so, that SLF4J is gaining a lot of popularity.

    Considering that you are not interested in using Tomcat with Log4j, you should just use Log4j directly in your application. Particularly if there is no chance that you’ll be switching logging frameworks in the future. It’ll reduce the complexity of your application, and get rid of any class loader issues you are having with commons-logging.

    This should be a relatively easy search and replace in your text, as commons-logging and log4j both use a similar call structure for their logging methods.

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

Sidebar

Ask A Question

Stats

  • Questions 93k
  • Answers 93k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer The query on sysobjects + cursor + EXECUTE works. kinda… May 11, 2026 at 6:35 pm
  • Editorial Team
    Editorial Team added an answer This continues to frequently gather additional votes, even several years… May 11, 2026 at 6:35 pm
  • Editorial Team
    Editorial Team added an answer ptr_vector<A>::release returns a ptr_vector<A>::auto_type, which is a kind of light-weight… May 11, 2026 at 6:35 pm

Related Questions

I have a problem using the Java search function in Eclipse on a particular
I have a problem with a little .Net web application which uses the Amazon
I have a problem in my project with the .designer which as everyone know
I have a problem that confuses my users, being that although an item is

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

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.