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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T05:31:55+00:00 2026-06-05T05:31:55+00:00

My WAR is using a log4j FileAppender configured via a log4j.properties file under the

  • 0

My WAR is using a log4j FileAppender configured via a log4j.properties file under the classes/ directory inside the WAR.

I have configured my log4j appender as such:

# Set the root logger to DEBUG.
log4j.rootLogger=DEBUG

# MonitorLog - used to log messages in the Monitor.log file.
log4j.appender.MonitorAppender=org.apache.log4j.FileAppender
log4j.appender.MonitorAppender.File=MonitorLog.log
log4j.appender.MonitorAppender.layout=org.apache.log4j.PatternLayout
log4j.appender.MonitorAppender.layout.ConversionPattern= %-4r [%t] %-5p %c %x - %m%n

# Use the MonitorAppender to log all messages.
log4j.logger.*=DEBUG,MonitorAppender

With this configuration I am trying to achieve the following:

  • All log messages DEBUG-level and higher get logged (so everything)
  • I want the MonitorLog.log file to be located under Tomcat’s logs/ directory

Does this configuration achieve these items, and if not, what needs to change?

  • 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-05T05:31:57+00:00Added an answer on June 5, 2026 at 5:31 am

    If you know this WAR will only be deployed to a tomcat, you can take advantage of the system property catalina.base, which represents the root of your tomcat base folder (there is also a cataline.home, but they are often the same unless you have multiple tomcats running on the same machine and are sharing the server libs, but i digress).

    So update as follows:

    log4j.appender.MonitorAppender.File=${catalina.base}/logs/MonitorLog.log
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want to copy war file to tomcat web-app directory using NSIS setup. I
I have a log4j.properties that sit right under the src folder. When I building
I am trying to update files inside an existing WAR file using the ANT
i have a Maven 2 project setup which nicely packages a war file using
I have a WAR file that I have deployed to Tomcat 7.0.23 via the
I'm trying to deploy a Rails app as a WAR using Warbler. I have
I am generating xlsx file using Apache POI. On making the war and deploying
I have multiple (8) WAR files and 1 EAR file that I want to
We're deploying a WAR file into Tomcat 5.5 and it works fine if WEB-INF\classes
I successfully created my war file using warble. I am trying to deploy my

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.