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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T16:42:10+00:00 2026-05-30T16:42:10+00:00

I am using the log4j API for logging in my Java based Tomcat application

  • 0

I am using the log4j API for logging in my Java based Tomcat application and using version 1.2.14 (log4j-1.2.14.jar). The problem is that it creates more logs in the catalina.out log file, which are very micro level logs and not required for me. I am facing the problem of memory in my machine, and I want to reduce the logging of the log4j logger. Is there a way to reduce logs such that I can save my memory?

  • 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-30T16:42:11+00:00Added an answer on May 30, 2026 at 4:42 pm

    Setting a properties or a XML configuration file will allow you to control log4j output as stated in the log4j manual.

    An example of the properties file would be like this

    # Root logger option
    log4j.rootLogger=**ERROR**, file
    # Direct log messages to a log file
    log4j.appender.file=org.apache.log4j.RollingFileAppender
    log4j.appender.file.File=C:\\mylogging.log
    log4j.appender.file.MaxFileSize=1MB
    log4j.appender.file.MaxBackupIndex=1
    log4j.appender.file.layout=org.apache.log4j.PatternLayout
    log4j.appender.file.layout.ConversionPattern=%d{ABSOLUTE} %5p %c{1}:%L - %m%n
    

    Note the rootLogger parameter, as it controls how much information you get, whether you need only error messages or everything down to information messages.

    In order to set it properly, look in Log4j Configuration Using Properties File for extra information as you can also use it in the XML version (see Multiple Appenders Using XML File). Tip: place it in src/ or in project root.

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

Sidebar

Related Questions

I'm using Java Logging API in a simple Servlet application that uses Maven and
I am using Log4j API for maintaining logs in my Android Application. I am
Using log4j, I used to have an appender that logs directly to one of
I have a problem with Tomcat 5.5 and Java EE webapp libraries. I'm using
I am using Log4J in my application for logging. Previously I was using debug
I am using Log4j for logging my application activity. In my local environment it
I have a java application using log4j SyslogAppender (facility=USER) and I can see using
I am using the java.util.logging API and atatching several FileHandlers to a named logger
I am using log4j for logging in my Java project. My conversion pattern is
In my application iam using Log4j for logging.Presently I am placing log4j.xml in WEB-INF/classes.

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.