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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T20:48:35+00:00 2026-06-08T20:48:35+00:00

I am using a apache’s log4j for logging errors in my application. When I

  • 0

I am using a apache’s log4j for logging errors in my application. When I start the tomcat server, the log info information is written into the log file as expected (Also the log info is written into the log file when I stop the tomcat server). But when I start using the application, I log information I am expecting to be written through the app is not written into the log file. For e.g. I am giving inputs that will give exception, but the log.error(e,e) isn’t getting written in the log file.

this is how i am using the Logger
static Logger log = Logger.getLogger(MyClass.class);

log.info("my message" );
log.error(e,e);

Please help

EDIT: Adding log4j.properties file contents

log4j.rootLogger =INFO, FILE, stdout
log4j.appender.FILE=org.apache.log4j.RollingFileAppender
log4j.appender.FILE.File=${catalina.home}/logs/myapp.log
log4j.appender.FILE.layout=org.apache.log4j.PatternLayout
log4j.appender.FILE.layout.ConversionPattern=%d{ABSOLUTE} %5p\t\t%c{1} :%L - %m%n

  • 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-08T20:48:38+00:00Added an answer on June 8, 2026 at 8:48 pm

    It seems that you have not configured your logger. Please find log4j.xml or logging.properties typically located under TOMCAT_HOME/conf. Edit them to include your application’s package.

    This will help you to write your application level log messages to log file of your server (tomcat).

    Better way is to manage your own logging configuration and files. Create log4j.xml file and put it under WEB-INF/classes into your application. You can find a lot of examples and tutorials that will help you to write your log4j.xml. For example this one: http://logging.apache.org/log4j/1.2/manual.html

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

Sidebar

Related Questions

I am using apache-tomcat-6.0.18 and want to configure log4j for tomcat internal logging. I
I am using apache tomcat as a web server. I have deployed webservices on
We are using apache commons logging in our application for all our logging requirements.
I am using Apache/2.2.14 and Apache Tomcat/6.0.29 in a Ubuntu Server 10.04.3 LTS .
I am using apache logger api for logging the messages, warnings, errors and exception.
I am using apache web server as a load balancer for two tomcat instances
I am using Apache Solr for one of my Drupal sites. I start my
I am using apache commons-net for downloading a file from an FTP server. That
I am using Apache Shiro in a web-application. The login and authentication check works
I'm using apache lucene for indexing and searching in my application. Everything is working

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.