You are viewing a plain text version of this content. The canonical link for it is here.
Posted to log4j-user@logging.apache.org by Loren Cahlander <lo...@gmail.com> on 2009/11/28 00:12:24 UTC

I am trying to add chainsaw support to the eXist XML Database

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

Re: I am trying to add chainsaw support to the eXist XML Database

Posted by Scott Deboy <sc...@gmail.com>.
I just updated Chainsaw to use the 1st argument as the configuration URL
instead of the log4j.configuration system property - and it overrides the
initial auto-config setting, so it can be used to build shortcuts, for
example, with different configurations.

If you have pulled svn HEAD of log4j, chainsaw and the companions, I'd run
this on each:

mvn -Dmaven.test.skip=true install

Some modules may ask you to run mvn site:site prior to mvn install, but you
should be successful with svn HEAD of everything (I went through and made
sure the maven configuration files didn't require manual install of any
dependencies, but you have to be online for it to work.

Scott

On Thu, May 20, 2010 at 11:46 PM, mokader <mo...@cisco.com> wrote:

>
> Hi Scott,
>
> I am not familiar with maven, but still I tried to checkout source from
> repositary and tried mvn install.
>
> build is successfull for extras and component.
> but the build failed for receivers.
>
> Is there any other way to get the latest build, other than building it from
> source myself.
>
> Thanks,
> Mohammed
>
>
> Scott Deboy wrote:
> >
> >> I just committed a change to Chainsaw svn trunk (rev 946685) which
> >> provides
> >> support for using the log4j.configuration system property on the command
> >> line to configure Chainsaw if the application-wide preferences field is
> >> not
> >> set (or cleared out and Chainsaw is restarted).
> >>
> >> The configuration.url must provide a URL
> >>
> >> java -classpath (classpath here)
> >> -Dlog4j.configuration=file:///c:/downloads/tools/log4j/config/log4j.xml
> >> org.apache.log4j.chainsaw.LogUI
> >
>
> --
> View this message in context:
> http://old.nabble.com/I-am-trying-to-add-chainsaw-support-to-the-eXist-XML-Database-tp26548991p28630204.html
> Sent from the Log4j - Users mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org
> For additional commands, e-mail: log4j-user-help@logging.apache.org
>
>

Re: I am trying to add chainsaw support to the eXist XML Database

Posted by mokader <mo...@cisco.com>.
Hi Scott,

I am not familiar with maven, but still I tried to checkout source from
repositary and tried mvn install.

build is successfull for extras and component.
but the build failed for receivers.

Is there any other way to get the latest build, other than building it from
source myself.

Thanks,
Mohammed


Scott Deboy wrote:
> 
>> I just committed a change to Chainsaw svn trunk (rev 946685) which
>> provides
>> support for using the log4j.configuration system property on the command
>> line to configure Chainsaw if the application-wide preferences field is
>> not
>> set (or cleared out and Chainsaw is restarted).
>>
>> The configuration.url must provide a URL
>>
>> java -classpath (classpath here)
>> -Dlog4j.configuration=file:///c:/downloads/tools/log4j/config/log4j.xml
>> org.apache.log4j.chainsaw.LogUI
> 

-- 
View this message in context: http://old.nabble.com/I-am-trying-to-add-chainsaw-support-to-the-eXist-XML-Database-tp26548991p28630204.html
Sent from the Log4j - Users mailing list archive at Nabble.com.


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


Re: I am trying to add chainsaw support to the eXist XML Database

Posted by Scott Deboy <sc...@gmail.com>.
I may change this to work the other way (if the command line arg is present,
use it instead of an auto-config url)...and I may change the mechanism to a
regular command line argument to Chainsaw instead of using a system
property..it could then be passed through more easily (say via shortcuts,
etc).

Scott


On Thu, May 20, 2010 at 9:19 AM, Scott Deboy <sc...@gmail.com> wrote:

> I just committed a change to Chainsaw svn trunk (rev 946685) which provides
> support for using the log4j.configuration system property on the command
> line to configure Chainsaw if the application-wide preferences field is not
> set (or cleared out and Chainsaw is restarted).
>
> The configuration.url must provide a URL
>
> java -classpath (classpath here)
> -Dlog4j.configuration=file:///c:/downloads/tools/log4j/config/log4j.xml
> org.apache.log4j.chainsaw.LogUI
>
> Scott
>
>
> On Thu, May 20, 2010 at 7:28 AM, mokader <mo...@cisco.com> wrote:
>
>>
>> Hi Scott,
>>
>> Thanks for your quick reply.
>>
>> My application is executable and will be distributed to users, my users
>> also
>> view logs.
>> for example, if a user press "view log" button, I need to open chainsaw.
>>
>> As you said, I can configure in application-wide preferences screen, only
>> after launching the chainsaw.
>> I want to launch it pre-configured, like using command-line parameters
>> when
>> chainsaw main class is launched.
>>
>> Is there a way to send configuration file path as the command-line
>> arguments?
>>
>> Thanks,
>> Mohammed
>>
>>
>> Scott Deboy wrote:
>> >
>> > you can specify the URL to the configuration file in the
>> application-wide
>> > preferences screen - specifying the URL to your configuration will cause
>> > the
>> > configuration to be used each time Chainsaw is started.
>> >
>>
>> --
>> View this message in context:
>> http://old.nabble.com/I-am-trying-to-add-chainsaw-support-to-the-eXist-XML-Database-tp26548991p28622012.html
>> Sent from the Log4j - Users mailing list archive at Nabble.com.
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org
>> For additional commands, e-mail: log4j-user-help@logging.apache.org
>>
>>
>

Re: I am trying to add chainsaw support to the eXist XML Database

Posted by Scott Deboy <sc...@gmail.com>.
I just committed a change to Chainsaw svn trunk (rev 946685) which provides
support for using the log4j.configuration system property on the command
line to configure Chainsaw if the application-wide preferences field is not
set (or cleared out and Chainsaw is restarted).

The configuration.url must provide a URL

java -classpath (classpath here)
-Dlog4j.configuration=file:///c:/downloads/tools/log4j/config/log4j.xml
org.apache.log4j.chainsaw.LogUI

Scott

On Thu, May 20, 2010 at 7:28 AM, mokader <mo...@cisco.com> wrote:

>
> Hi Scott,
>
> Thanks for your quick reply.
>
> My application is executable and will be distributed to users, my users
> also
> view logs.
> for example, if a user press "view log" button, I need to open chainsaw.
>
> As you said, I can configure in application-wide preferences screen, only
> after launching the chainsaw.
> I want to launch it pre-configured, like using command-line parameters when
> chainsaw main class is launched.
>
> Is there a way to send configuration file path as the command-line
> arguments?
>
> Thanks,
> Mohammed
>
>
> Scott Deboy wrote:
> >
> > you can specify the URL to the configuration file in the application-wide
> > preferences screen - specifying the URL to your configuration will cause
> > the
> > configuration to be used each time Chainsaw is started.
> >
>
> --
> View this message in context:
> http://old.nabble.com/I-am-trying-to-add-chainsaw-support-to-the-eXist-XML-Database-tp26548991p28622012.html
> Sent from the Log4j - Users mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org
> For additional commands, e-mail: log4j-user-help@logging.apache.org
>
>

Re: I am trying to add chainsaw support to the eXist XML Database

Posted by mokader <mo...@cisco.com>.
Hi Scott,

Thanks for your quick reply.

My application is executable and will be distributed to users, my users also
view logs.
for example, if a user press "view log" button, I need to open chainsaw.

As you said, I can configure in application-wide preferences screen, only
after launching the chainsaw.
I want to launch it pre-configured, like using command-line parameters when
chainsaw main class is launched.

Is there a way to send configuration file path as the command-line
arguments?

Thanks,
Mohammed


Scott Deboy wrote:
> 
> you can specify the URL to the configuration file in the application-wide
> preferences screen - specifying the URL to your configuration will cause
> the
> configuration to be used each time Chainsaw is started.
> 

-- 
View this message in context: http://old.nabble.com/I-am-trying-to-add-chainsaw-support-to-the-eXist-XML-Database-tp26548991p28622012.html
Sent from the Log4j - Users mailing list archive at Nabble.com.


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


Re: I am trying to add chainsaw support to the eXist XML Database

Posted by Scott Deboy <sc...@gmail.com>.
Create an xml configuration file specifying a LogFilePatternReceiver - there
is an example receiver configuration file on the Welcome tab, and you can
specify the URL to the configuration file in the application-wide
preferences screen - specifying the URL to your configuration will cause the
configuration to be used each time Chainsaw is started.

The LogFilePatternReceiver javadoc describes how to specify the format of
the file and other parameters (available from Chainsaw's help menu).

Scott

On Thu, May 20, 2010 at 5:25 AM, mokader <mo...@cisco.com> wrote:

>
> Hi Scott,
>
> For my existing application, we are using log4j and we have log file
> appender.
> I want to use chainsaw as the log viewer and need to load the file
> automatically.
> How to configure chainsaw to open a file when chainsaw is started.
>
> Thanks in advance,
> Mohammed
>
>
> Scott Deboy wrote:
> >
> > Chainsaw does have a receiver that can parse regular text files
> > (LogFilePatternReceiver, and VFSLogFilePatternReceiver, which supports
> > jakarta-commons-vfs file systems).
> >
>
> --
> View this message in context:
> http://old.nabble.com/I-am-trying-to-add-chainsaw-support-to-the-eXist-XML-Database-tp26548991p28620483.html
> Sent from the Log4j - Users mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org
> For additional commands, e-mail: log4j-user-help@logging.apache.org
>
>

Re: I am trying to add chainsaw support to the eXist XML Database

Posted by mokader <mo...@cisco.com>.
Hi Scott,

For my existing application, we are using log4j and we have log file
appender.
I want to use chainsaw as the log viewer and need to load the file
automatically.
How to configure chainsaw to open a file when chainsaw is started.

Thanks in advance,
Mohammed


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

-- 
View this message in context: http://old.nabble.com/I-am-trying-to-add-chainsaw-support-to-the-eXist-XML-Database-tp26548991p28620483.html
Sent from the Log4j - Users mailing list archive at Nabble.com.


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


Re: I am trying to add chainsaw support to the eXist XML Database

Posted by Scott Deboy <sc...@gmail.com>.
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
good:

%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:
TIMESTAMP [THREAD] LEVEL (FILE [METHOD]: LINE) - MESSAGE

By the way, on XP, the fileURL on the local disk should look something like
this:
"file:///c:/path/to/my.log"

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.

Scott

On Fri, Nov 27, 2009 at 3:12 PM, Loren Cahlander
<lo...@gmail.com>wrote:

> 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