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 6923375
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T10:31:41+00:00 2026-05-27T10:31:41+00:00

I have 2 web applications built from the same source tree within tomcat, which

  • 0

I have 2 web applications built from the same source tree within tomcat, which each use a PropertyConfigurator loading their respective /webapp/WEB-INF/classes/log4j.properties.

Currently tomcat is configured to use one console appender for the whole container, and both app’s log4js just write to the console:

log4j.rootCategory=info, A1
log4j.appender.A1=org.apache.log4j.ConsoleAppender

This means I end up with one big catalina.out for the whole container.

I would like to configure each of the applications log4js so that they append to their own separate rolling files.

I’m aware I can use system properties substitution within log4j.properties however isn’t system properties shared across the VM and therefore not threadsafe between the 2 applications within the container?

Can someone suggest a tidy solution which allows me to configure the 2 applications to log to separate files, preferably with the application’s context name within the log’s file name.

thanks, p.

  • 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-05-27T10:31:41+00:00Added an answer on May 27, 2026 at 10:31 am

    Where is your log4j.jar and commons-logging.jar placed in tomcat directory? And which version of tomcat you are using?

    If you have one copy of these jar inside common/lib than surely catalina.log would be used by all logging since tomcat’s log4j.properties file is only the one getting configured for both server and webapps under it.

    Assuming this scenario holds valid in your case, copy log4j.jar and common-logging.jar under WEB-INF/lib for both web applications.

    For using application name within log’s file name, since separate log4j.properties file is used for each application, name your logfiles as you like in log4j.properties file against FileAppender or RollingFileAppender.

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

Sidebar

Related Questions

The web-application is a custom-built CMS which has several sub-applications and each one of
I have an application that will accept URLs from the built in web browser
I have built Web sites with Python/Django and desktop applications with Objective-C/Cocoa so programming
I have an ASP.Net 4.0 web application which very frequently loads data from the
I have a desktop application built with jdk 6 which publishes web services to
I have a web application built in asp.net, which uses resource files to support
All, I have a PHP Web application built using Zend Framework and MVC with
I'm early in development on a web application built in VS2008. I have both
We have built a web application that accepts SOAP messages, does some processing, calls
I have built a web application using Java EE platform that sells one of

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.