logging-log4j-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Scott Deboy <scott.de...@gmail.com>
Subject Re: I am trying to add chainsaw support to the eXist XML Database
Date Sat, 28 Nov 2009 00:15:01 GMT
I quickly looked at an exist-db log4j configuration I found online (from
your 1.2 release)..

Chainsaw does have a receiver that can parse regular text files
(LogFilePatternReceiver, and VFSLogFilePatternReceiver, which supports
jakarta-commons-vfs file systems).

The filepatternreceiver has the most success at parsing text log files when
there are clear delimiters between fields, which means your format is pretty

%d [%t] %-5p (%F [%M]:%L) - %m %n

I would replace %-5p with %-7p or something like that, since WARNING is >5
characters and will be truncated  - if Chainsaw can't parse a level, it will
assume the entry's level is DEBUG..

Next, start the Web Start (or bundle) version of Chainsaw, go to the Welcome
tab and click on 'view example receiver configuration' button.  Copy that
text, remove all 'plugin' entries except for the LogFilePatternReceiver
entry and modify the logFormat, fileURL and possibly timeStamp params to
match your log file location & format.

Save that file, go to the 'view, application-wide preferences' menu and
provide the -URL- to that configuration file in the 'automatic configuration
URL' field and hit ok.  The file should start to load in its own tab.  If it
doesn't, the chainsaw-log tab should provide information why it's not
parsing correctly.

If you're using a pattern layout like this:
%d [%t] %-7p (%F [%M]: %L) - %m %n

Use a logFormat param like this:

By the way, on XP, the fileURL on the local disk should look something like

Tailing may or may not work with a file:// URL on windows with
LogFilePatternReceiver (for the Web Start/bundle version) - it's greatly
improved in svn HEAD.

You can find information on logFormat from the Chainsaw help/Receiver
Javadoc/LogFilePatternReceiver menu.  Also read the info available from the
built-in tutorial (help/tutorial menu)

Once you have that working, using VFS-supported file systems (remote tailing
over ssh) just means
  - downloading the VFS dependencies & getting them into the
$userhome/.chainsaw/plugins folder or into the classpath
  - modifying the chainsaw configuration file by changing the plugin class
to reference the VFSLogFilePatternReceiver class
  - modifying the chainsaw configuration file by using a fileURL supported
by Jakarta commons-vfs

Again, many fixes (and enhancements) have been made on svn trunk that you
won't see in the Web Start/released bundle version.

Feel free to email with more questions or a small section of the log if you
have problems getting Chainsaw to process your log file.


On Fri, Nov 27, 2009 at 3:12 PM, Loren Cahlander

> Hello Folks of the log4j-user mailing list,
> I am a contributor to the eXist XML Database.  I want to add the ability to
> use chainsaw against the database server.  What I would like to do is in two
> phases.
> The first phase is just to get chainsaw working with the localhost server.
>  The chainsaw instructions that I have found are not clear enough for me to
> get it working.  Could someone on the list take a look at eXist's log4j.xml
> file and suggest changes and a configuration file for chainsaw?
> The second phase is to create an appender that will use a secure connection
> to the server from an outside server using the admin username and password
> from the eXist database.  Can someone send me a link to a page instructing
> me on what class I need to create a subclass off of?
> Thank you,
> Loren Cahlander

  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message