commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Reid Pinchback <rei...@yahoo.com>
Subject Re: [Digester]how to debug in degister
Date Wed, 08 Sep 2004 01:46:21 GMT
Just to add my two cents to the other responses,
Digester only uses two logging categories, 
"...Digester" and "...Digester.sax".  That
means that you can't use the usual Log4J config 
hacks of tweaking category priorities to reduce
noise.  You'll want to make effective use of 
all the Log4J options, in particular:

- pattern layout options to show you the class
  and method being invoked (something folks
  tend not to use because of the performance
  hit - don't leave these on for long, just
  long enough to track down a problem).

- filters to control which messages you see.

Here is an example of a log4.xml file that
will let you do both.  The filters are commented
out so that initially you get all Digester DEBUG
and Digester.sax INFO messages.  If you uncomment
the filters then you'll restrict yourself to
messages that contain the specified string
(ObjectCreateRule in this case).  You can add
more StringToMatch filters to allow more and
more log messages through; the final DenyAllFilter
junks anything you don't want.


<?xml version='1.0' encoding='UTF-8' ?>

<!DOCTYPE log4j:configuration SYSTEM 'log4j.dtd'>

<log4j:configuration
xmlns:log4j='http://jakarta.apache.org/log4j/'
debug='false'>

  <appender name='CONSOLE'
class='org.apache.log4j.ConsoleAppender'>
    <param name='Target' value='System.out'/>
    <layout class='org.apache.log4j.PatternLayout'>
      <param name='ConversionPattern'
value='%d{ABSOLUTE} %-5p [%C{2}.%M] %m%n'/>
    </layout>
<!--
    <filter
class='org.apache.log4j.varia.StringMatchFilter'>
      <param name='StringToMatch'
value='ObjectCreateRule' />
    </filter>
    <filter
class='org.apache.log4j.varia.DenyAllFilter'/>
-->
  </appender>

  <category
name='org.apache.commons.digester.Digester'><priority
value='DEBUG'/></category>
  <category
name='org.apache.commons.digester.Digester.sax'><priority
value='INFO'/></category>

  <root>
    <priority value='INFO'/>
    <appender-ref ref='CONSOLE'/>
  </root>

</log4j:configuration>



--- Gao Di <jaoyina@yahoo.com.cn> wrote:

> i find the setlogger() and getlogger() method in
> digester,but i have never used any log api,anyone
> can
> tell me how to use it and let me see the log
> infomation to help me debug?
> 
>
_________________________________________________________
> Do You Yahoo!?
> 150万曲MP3疯狂搜,带您闯入音乐殿堂
> http://music.yisou.com/
> 美女明星应有尽有,搜遍美图、艳图和酷图
> http://image.yisou.com
> 1G就是1000兆,雅虎电邮自助扩容!
>
http://cn.rd.yahoo.com/mail_cn/tag/1g/*http://cn.mail.yahoo.com/event/mail_1g/
> 
>
---------------------------------------------------------------------
> To unsubscribe, e-mail:
> commons-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail:
> commons-user-help@jakarta.apache.org
> 
> 


__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 

---------------------------------------------------------------------
To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-user-help@jakarta.apache.org


Mime
View raw message