logging-log4j-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Scott Deboy" <sde...@comotivsystems.com>
Subject RE: Use Chainsaw in existing Swing application
Date Thu, 10 Apr 2008 06:43:20 GMT
If you want to slice & dice events, Chainsaw works well.  

If you have a static filter you'd like to apply to your events (for example, only display
INFO or higher events), you can do that through a log4j config with your own appender - see
LevelMatchFilter (http://logging.apache.org/log4j/1.2/apidocs/org/apache/log4j/varia/LevelMatchFilter.html)

The 'extras' companion also contains ExpressionFilter, which allows you to specif a filter
expression using the same syntax you use in Chainsaw to filter events.  See http://logging.apache.org/log4j/companions/extras/download.html

Scott Deboy
COMOTIV SYSTEMS
111 SW Columbia Street Ste. 950
Portland, OR  97201

Telephone:      503.224.7496
Cell:           503.997.1367
Fax:            503.222.0185

sdeboy@comotivsystems.com

www.comotivsystems.com



-----Original Message-----
From: Sertic Mirko, Bedag [mailto:Mirko.Sertic@bedag.ch]
Sent: Wed 4/9/2008 11:33 PM
To: Log4J Users List
Subject: AW: Use Chainsaw in existing Swing application
 
Ok, that is a good idea. But if I want to have filters and everything else?

-----Urspr√ľngliche Nachricht-----
Von: Scott Deboy [mailto:sdeboy@comotivsystems.com] 
Gesendet: Donnerstag, 10. April 2008 08:26
An: Log4J Users List
Betreff: RE: Use Chainsaw in existing Swing application

If your users don't need the two-level filtering (filter tree and filter expression) and column-level
sorting supported by Chainsaw, it'd probably make sense to create your own appender which
populates a cyclic buffer - the cyclic buffer can be the data behind a JTable or JList that
you display in your app.


Scott Deboy
COMOTIV SYSTEMS
111 SW Columbia Street Ste. 950
Portland, OR  97201

Telephone:      503.224.7496
Cell:           503.997.1367
Fax:            503.222.0185

sdeboy@comotivsystems.com

www.comotivsystems.com



-----Original Message-----
From: Sertic Mirko, Bedag [mailto:Mirko.Sertic@bedag.ch]
Sent: Wed 4/9/2008 11:13 PM
To: Log4J Users List
Subject: AW: Use Chainsaw in existing Swing application
 
Hi Scott

Thank you for your reply.

So do I have to wait for the next release, or can I get the fixed version from CVS/SVN or
somewhere else?

I am thinking of the following usecase for my application:

The application start.
The user can click a menu item -> show application logs chainsaw should start showing every
log entry since application startup ( in a different frame, or a modal dialog ).

Would this be possible, or do I have to write my own log viewer?

Regards
Mirko

-----Urspr√ľngliche Nachricht-----
Von: Scott Deboy [mailto:sdeboy@comotivsystems.com]
Gesendet: Mittwoch, 9. April 2008 18:42
An: Log4J Users List
Betreff: RE: Use Chainsaw in existing Swing application

The org.apache.log4j.chainsaw.ChainsawAppender appender will allow you to start Chainsaw when
your UI launches (or you can do it yourself programmatically using the same code the appender
uses).

However...Chainsaw won't work with this appender until the next release of Chainsaw (I just
committed a fix to Chainsaw to support this appender). 

Here's an example appender configuration that you can add to your log4j xml file to get Chainsaw
to load:

<appender name="CHAINSAW-UI"
class="org.apache.log4j.chainsaw.ChainsawAppender">
  <param name="viewerClass" value="org.apache.log4j.chainsaw.LogUI"/>
</appender>

And then add that appender to your root logger with an appender-ref:

<root>
<appender-ref ref="CHAINSAW-UI"/>
</root>


Scott Deboy
Principal Engineer
COMOTIV SYSTEMS
111 SW Columbia Street Ste. 950
Portland, OR  97201
Office: 503.224.7496
Direct Line: 503.821.6482
Cell: 503.997.1367
Fax: 503.222.0185
sdeboy@comotivsystems.com
www.comotivsystems.com

-----Original Message-----
From: Sertic Mirko, Bedag [mailto:Mirko.Sertic@bedag.ch]
Sent: Wednesday, April 09, 2008 8:32 AM
To: log4j-user@logging.apache.org
Subject: Use Chainsaw in existing Swing application

Hi@all!

Is it possible to integrate Chainsaw into an existing GPL bases Swing application?
Can it be run as a component in another JFrame? How should that be done?

Thanks in advance

Mirko


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


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




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




Mime
View raw message