HI !

I've encountered exactly the same problem : a solution i've used is to
configure your root logger to be high level (say for example ERROR) and
configure your packages to be low level for your debug needs (say for
example com.myCompany to be DEBUG)

this could give this kind of property file :

> log4j.rootCategory=WARN, emslog
        log4j.logger.com.foo=DEBUG
> log4j.appender.emslog=org.apache.log4j.RollingFileAppender
> log4j.appender.emslog.File=C:\\somewhereOnMyMachine\\ems.log
> log4j.appender.emslog.layout=org.apache.log4j.PatternLayout
> log4j.appender.emslog.layout.ConversionPattern=%5p %d (%F:%L) - %m%n

As hierarchy plays its role you'll get all categories other than those
beginning with com.foo be in WARN level prventing any traces from Struts. To
be more precise you could also leave the root category as DEBUG but be more
restrictive on org.apache category.

Hope this is clear enough. Don't hesitate if it's not...

Fabrice DEWASMES


> -----Message d'origine-----
> De : Joe Latty [mailto:[EMAIL PROTECTED]]
> Envoyé : vendredi 28 juin 2002 09:47
> À : Struts Users Mailing List
> Objet : log4j and struts
>
>
> I have set up log4j to run with my app, it all works fine, however I get
> about 1 billion (ok maybe a billion is an exageration) DEBUG lines written
> from struts endless stuff like this;
>
> DEBUG 2002-06-28 17:30:48,317 (Log4JCategoryLog.java:132) -  Validating
> input form properties
> DEBUG 2002-06-28 17:30:48,317 (Log4JCategoryLog.java:115) -   No errors
> detected, accepting input
> DEBUG 2002-06-28 17:30:48,327 (Log4JCategoryLog.java:132) -  Looking for
> Action instance for class com.ems.action.SomethingAction
> DEBUG 2002-06-28 17:30:48,327 (Log4JCategoryLog.java:115) -   Creating new
> Action instance
>
> making it unusable for tracking down app specific debugging.
>
> HELP!
>
>
> In the log4j.properties file
>
> log4j.rootCategory=DEBUG, emslog
> log4j.appender.emslog=org.apache.log4j.RollingFileAppender
> log4j.appender.emslog.File=C:\\somewhereOnMyMachine\\ems.log
> log4j.appender.emslog.layout=org.apache.log4j.PatternLayout
> log4j.appender.emslog.layout.ConversionPattern=%5p %d (%F:%L) - %m%n
>
> then in my classes I have a static variable
>
> static Category cat = Category.getInstance(MyClass.class.getName());
>
> which then does;
>
> cat.debug(theSqlStatement);
>
> Thanks for any help
>


--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to