I tried two configurations, but it still shows the debug statements of the thirdparty lib.

I tried this first:
-------------------------------------
<category name="org.thirdpary.*" additivity="false">
 <priority value="WARN" />
<appender-ref ref="FILE" />
</category>

<category name="com.myapp.*" additivity="false">
     <priority value="DEBUG" />
     <appender-ref ref="FILE" />
</category>

<root>
 <priority value="DEBUG" />
 <appender-ref ref="FILE" />
</root>
-------------------------------------
And then, I tried the this:

-------------------------------------
<logger name="org.thirdparty.*">
<!-- Print only messages of level warn or above in the package com.foo -->
     <level value="WARN"/>
</logger>

<category name="com.myapp.*" additivity="false">
     <priority value="DEBUG" />
     <appender-ref ref="FILE" />
</category>

<root>
 <priority value="DEBUG" />
 <appender-ref ref="FILE" />
</root>
-------------------------------------


Both of them do not work. Is there some error in the configuration ??

Thanks

Aneez Backer

--
Get everybody talkin' about your blog! Get the Free Tell-A-Friend widget
for your blog/site at http://tellafriend.socialtwist.com.


----- Original Message ----- From: "Curt Arnold" <[EMAIL PROTECTED]>
To: "Log4J Users List" <[email protected]>
Sent: Thursday, September 11, 2008 10:57 AM
Subject: Re: how to Ignore log statements from some modules



On Sep 11, 2008, at 12:15 AM, Aneez Backer wrote:

hi

I am using a third party library for my application. I wish to ignore the log statements originating from this library, but at the same time I wish to log the statements for the classes I have written. What should be done in the log4j.xml file to achieve this ??

Thanks,

Aneez

If the third party library uses logger names like "com.example.foolib....", then set the level of "com.example.foolib" to OFF (or likely better ERROR) and the level of the root logger to the level of interest in your own class, or you could set the root logger to OFF or ERROR and set the level of "net.example.myapp" to DEBUG or INFO.

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


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

Reply via email to