wood burning stoves 2.0*
The moose likes Struts and the fly likes Struts1.1 And Log4j Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Struts1.1 And Log4j" Watch "Struts1.1 And Log4j" New topic
Author

Struts1.1 And Log4j

Sahil Singh
Ranch Hand

Joined: Sep 03, 2003
Posts: 41
Hi Guys have a problem.

AM using Log4j for logging with Struts1.1.

When i start up the application.

It start with atleast "4 minutes ANNOYING " logging outputs.....

And then runs fine..

Is there any way i can stop this unwanted log outputs...


Following is the files i have:-


log4j.properties:-

##################
log4j.rootLogger=debug, stdout

log4j.appender.stdout=org.apache.log4j.ConsoleAppender
log4j.appender.stdout.layout=org.apache.log4j.PatternLayout

# Pattern to output the caller's file name and line number.
log4j.appender.stdout.layout.ConversionPattern=%5p [%t] (%F:%L) - %m%n
##################


Loading it in web.xml:-

##################
<init-param>
<param-name>log4j.properties</param-name>
<param-value>/WEB-INF/classes/log4j.properties</param-value>
</init-param>
##################

Also if i edit anything (using wsad4.0.3)ans save it,again it start the annoying "debug logs" for another 3-4 minutes...

Is something else i have to do?

Thanks In advance,
Sahil
[ June 18, 2004: Message edited by: Sahil Singh ]
Sahil Singh
Ranch Hand

Joined: Sep 03, 2003
Posts: 41
Basically testing further i did

import org.apache.log4j.Logger;

Class defination...etc

Logger logger = Logger.getLogger(CLASSABCDAction.class);



System.out.println(logger.getEffectiveLevel()); gives me "DEBUG";

but the next line : logger.debug("TESTING DEBUG"); is not printed


Please advice,
Thanks,
Sahil
[ June 18, 2004: Message edited by: Sahil Singh ]
Sahil Singh
Ranch Hand

Joined: Sep 03, 2003
Posts: 41
Or i would say in other words,
Is there any way to Stop the DEBUG outputs of Struts1.1 and only allow DEBUGS
of one written in my application.

Thanks,
Sahil
[ June 20, 2004: Message edited by: Sahil Singh ]
Sriram Chandrasekaran
Greenhorn

Joined: Oct 08, 2003
Posts: 17
well just specify a different logger for all apache struts stuff

add something like

log4j.logger.org.apache=WARN
in your log4j config file to suppress log4j debug statements...what this will do is log4j will use this logger for all classed in pkg starting with org.apache

-sri
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Struts1.1 And Log4j