Here's an example configuration you could use with Chainsaw V2 that will 
receive events generated by a SocketAppender, and if a received event has a 
level of WARN or greater, a sound is played.

Notice how the SoundAppender uses a chain of filters - an ExpressionFilter that 
accepts a match, followed by a DenyAllFilter (only events matching the 
expression generate a sound). 

<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE log4j:configuration >
<log4j:configuration xmlns:log4j="http://jakarta.apache.org/log4j/"; 
debug="true">
   <plugin name="SocketReceiver" class="org.apache.log4j.net.SocketReceiver">
     <param name="Port" value="4445"/>
   </plugin>

   <appender name="sound" class="org.apache.log4j.varia.SoundAppender">
     <param name="audioURL" value="file:///c:/windows/media/chimes.wav"/>
     <filter class="org.apache.log4j.filter.ExpressionFilter">
       <param name="Expression" value="LEVEL >= WARN"/>
       <param name="AcceptOnMatch" value="true"/>
       <param name="ConvertInFixToPostFix" value="true"/>
     </filter>
     <filter class="org.apache.log4j.filter.DenyAllFilter"/>
   </appender>
        
   <root>
     <level value ="debug"/>
     <appender-ref ref="sound"/>
   </root>
</log4j:configuration>






 


-----Original Message-----
From: news on behalf of Rakesh Patel
Sent: Wed 9/7/2005 6:06 AM
To: [email protected]
Subject:  Re:  Re: Chainsaw Features I'd Like To See
 
Scott Deboy <sdeboy <at> comotivsystems.com> writes:

> 
> Added SoundAppender to CVS HEAD - should be available in next 1.3 alpha 
release.
> 
> See http://cvs.apache.org/viewcvs.cgi/logging-
log4j/src/java/org/apache/log4j/varia/SoundAppender.java?rev=1.1&view=markup
> 
> You'll need to add a filter to this appender specifying which events match 
(LevelMatchFilter or
> ExpressionFilter), followed by a DenyAllFilter.
> 
> Scott
> 

forgive me scott, but i was not able to understand how i would be able to use 
the soundappender. if it's not too much trouble, can you explain it once more 
with some specific step by step details?

thanks
rakesh




---------------------------------------------------------------------
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