File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Other Open Source Projects and the fly likes what does log4j info level mean Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Products » Other Open Source Projects
Bookmark "what does log4j info level mean" Watch "what does log4j info level mean" New topic

what does log4j info level mean

Archana Annamaneni
Ranch Hand

Joined: Jan 29, 2003
Posts: 147
hi ,

I have configured my log4j propertis file as following

log4j.rootLogger=info, R



And in one my Struts Action classes
I included some"xxxxxx")statements.

But the log file has these other info messages also , how do i avoid these?

INFO - Initializing, config='org.apache.struts.util.LocalStrings', returnNull=true
INFO - Initializing, config='org.apache.struts.action.ActionResources', returnNull=true

what should i do to include only my own log statemens.

Carol Enderlin
Ranch Hand

Joined: Oct 10, 2000
Posts: 1364
You set up your root logger at info level using "R" appender; this means that all log4j logging will go that appender including third party products.

You can do the following

1. put a logger in your properties file for the struts package such as ""

2. with the struts logger using a different appender and/or set to a different level

# only warnings or higher logging to a different appender (you would
# need to define that different appender),STRUTS

# same appender, higher level,R

3. and you need to turn off additivity on the struts logging

The additivity part says for this logger, don't log to appenders attached to any loggers up the hierarchy (root logger in this case). This is important to keep from getting duplicate messages.

If you're just getting struts set up in your project it is good to keep the struts logging turned on (but to a different appender so that it doesn't clutter up your logging) so you can see what might be going wrong with the struts setup.

Check out the log4j manual for syntax and more explanation.
I agree. Here's the link:
subject: what does log4j info level mean
It's not a secret anymore!