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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T05:09:51+00:00 2026-05-18T05:09:51+00:00

When my logger is set to all, i am seeing messages that my code

  • 0

When my logger is set to “all”, i am seeing messages that my code does not explicitly place. I am using a jar a friend of mine gave me to do some things (and i suspect he is logging stuff himself)

I would like to ONLY log stuff I ask to be logged by issuing the

logger.info ("something clever"); command

Below is my log4j.properties

please advise.

# ***** Set root logger level to WARN and its two appenders to stdout and R.
log4j.rootLogger=all, R

# ***** R is set to be a RollingFileAppender.
log4j.appender.R=org.apache.log4j.RollingFileAppender
log4j.appender.R.File=log/something.log
# ***** Max file size is set to 100KB
log4j.appender.R.MaxFileSize=100KB
# ***** Keep one backup file
log4j.appender.R.MaxBackupIndex=1
# ***** R uses PatternLayout.
log4j.appender.R.layout=org.apache.log4j.PatternLayout
log4j.appender.R.layout.ConversionPattern=%p %t %c - %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-05-18T05:09:51+00:00Added an answer on May 18, 2026 at 5:09 am

    Take a look at this excellent log4j cheatsheet:

    • http://www.johnmunsch.com/projects/Presentations/docs/Log4J/log.properties

    Basically, you need to set something like this:

    log4j.rootCategory=error, R
    log4j.category.com.your.package=debug
    

    or, alternatively:

    log4j.category.com.your.friends.package=error
    

    Replace the package names as necessary.

    These would make the root logger set to error (so any package – including other libraries you might be using, like Hibernate, Spring, etc.) will not log anything low-level (debug, info, warn), but log only errors.

    It will also set your package (include your top level package or packages) to log on a debug level, so all your loggers will log normally. It will also set your friend’s package to error, so it doesn’t output anything.

    If you have a common root package, just use it. E.g. if you have packages:

    • com.example
    • com.example.a
    • com.example.a.aa
    • com.example.b
    • com.example.c.d

    just include com.example and it will inherit for the packages below by default.

    You could, of course, override it, e.g. specify:

    • com.example – warn
    • com.example.a.aa – debug

    or something similar. Take a look here for a detailed explanation:

    • 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

Every class that wants to use java.util.logging generally needs to declare a logger like
Using something like this: try: # Something... except Exception as excep: logger = logging.getLogger(component)
self.logger.info(msg) popinstance=poplib.POP3(self.account[0]) self.logger.info(popinstance.getwelcome()) popinstance.user(self.account[1]) popinstance.pass_(self.account[2]) try: (numMsgs, totalSize)=popinstance.stat() self.logger.info(POP contains + str(numMsgs) + emails)
public static Logger getLogger() { final Throwable t = new Throwable(); final StackTraceElement methodCaller
I have a logger system which basically is a fancy way of writing my
I'm trying to create a logger for a GWT application as an exercise to
I decided to use log4net as a logger for a new webservice project. Everything
I'm rolling my own logger class, and want to represent the heirarchy of logs
I was looking at the Ruby logging library Logging.logger method and have a question
I am trying to write a decorator to do logging: def logger(myFunc): def new(*args,

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.