Re: Chainsaw log-parsing classes

2018-01-20 Thread Scott Deboy
Yeah - good idea.

Here's the code Chainsaw uses to grab a log4j XML config's
FileAppender definition, including the PatternLayout, and build what's
needed to process the log messages going in to the target file.

BTW this is also how the log4j2 Advertiser integrates with Chainsaw.

  Map entries =
LogFilePatternLayoutBuilder.getAppenderConfiguration(log4jConfigFile);
  for (Iterator iter =
entries.entrySet().iterator();iter.hasNext();) {
try {
  Map.Entry entry = (Map.Entry)iter.next();
  String name = (String) entry.getKey();
  Map values = (Map) entry.getValue();
  //values: conversion, file
  String conversionPattern =
values.get("conversion").toString();
  File file = new File(values.get("file").toString());
  URL fileURL = file.toURI().toURL();
  String timestampFormat =
LogFilePatternLayoutBuilder.getTimeStampFormat(conversionPattern);
  String receiverPattern =
LogFilePatternLayoutBuilder.getLogFormatFromPatternLayout(conversionPattern);
  VFSLogFilePatternReceiver fileReceiver = new
VFSLogFilePatternReceiver();
  fileReceiver.setName(name);
  fileReceiver.setAutoReconnect(true);
  fileReceiver.setContainer(LogUI.this);
  fileReceiver.setAppendNonMatches(true);
  fileReceiver.setFileURL(fileURL.toURI().toString());
  fileReceiver.setTailing(true);
  fileReceiver.setLogFormat(receiverPattern);
  fileReceiver.setTimestampFormat(timestampFormat);
  fileReceiver.setThreshold(Level.TRACE);
  pluginRegistry.addPlugin(fileReceiver);
  fileReceiver.activateOptions();

Scott

On 1/20/18, Mikael Ståldal <mi...@apache.org> wrote:
> Maybe we could take some code from Chainsaw and implement a
> LogEventParser for Log4j 2?
>
> https://github.com/apache/logging-log4j2/blob/master/log4j-core/src/main/java/org/apache/logging/log4j/core/parser/TextLogEventParser.java
>
>
> On 2018-01-19 17:00, Scott Deboy wrote:
>> Here's info on how you can use the same Receiver Chainsaw uses in your
>> own
>> application - note this is not built in to log4j2:
>>
>> https://stackoverflow.com/questions/47605483/log4j-unstructured-log-parser-in-java-or-scala?rq=1
>>
>> Scott
>>
>> On Jan 19, 2018 7:32 AM, "Joseph Husby" <husby...@umn.edu> wrote:
>>
>> Hello!
>>
>>
>>
>> I’m working on a project where we need to take log4j2 output and
>> (offline)
>> load it into a Mongo database.  We can't use a mongo appender because the
>> database is not available where the software is running.  We could use
>> the
>> log4j2's JsonLayout to have an easily parsable log format, but would
>> prefer
>> not to as it makes the logs less human readable (especially timestamps).
>>
>>
>> Obviously Chainsaw has the capability to parse standard log4j output, but
>> is any of that exposed so we could use those classes in our application?
>> We don’t need the GUI component.
>>
>>
>>
>> Thank you for any help you’re able to provide!
>>
>>
>> ~ Joe ~
>>
>> p.s. resending this after subscribing to the list as I don't see my
>> original message in the archive, so assuming it was rejected.  Sorry if
>> I'm
>> double messaging!
>>
>
>
> -
> To unsubscribe, e-mail: log4j-user-unsubscr...@logging.apache.org
> For additional commands, e-mail: log4j-user-h...@logging.apache.org
>
>

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



Re: Stack Overflow Question

2017-09-03 Thread Scott Deboy
I commented in SO.  It worked with very minor changes to your test &
config, but you do have to use the latest version available in git.
It's not the version you can download from the website - that's very
old and doesn't include the log4j2 support yet.

On 9/3/17, Grzegorz Świeć  wrote:
> Forwarding my stack overflow question.
> How to open log4j2 logs with Appache Chainsaw
> https://stackoverflow.com/q/46022519/6608856?sem=2
>
> Hope you guys can help.
>
>

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



Re: Chainsaw Zeroconf FileAppender Error

2017-04-21 Thread Scott Deboy
It's just missing branding requirements and a vote.

On 4/21/17, Ralph Goers <ralph.go...@dslextreme.com> wrote:
> When are you going to release that?
>
> Ralph
>
>> On Apr 21, 2017, at 4:25 PM, Scott Deboy <scott.de...@gmail.com> wrote:
>>
>> Are you using the developer snapshot at
>>
>> http://people.apache.org/~sdeboy
>>
>> This stuff only works with this version.
>>
>> Scott
>>
>> On 4/21/17, Mohit Garg <mohi...@vt.edu> wrote:
>>> Hey Scott,
>>>
>>> I got the following error:
>>>
>>> Could not instantiate object of class
>>> [org.apache.log4j.chainsaw.vfs.VFSLogFilePatternReceiver]
>>> Could not create a plugin. Reported error follows.
>>> In ParamAction setting parameter [appendNonMatches] to value [true]
>>> In ParamAction setting parameter [autoReconnect] to value [false]
>>> In ParamAction setting parameter [fileURL] to value
>>> [file://home/mohit/example.log]
>>> and so on for all other parameters
>>>
>>> On Fri, Apr 21, 2017 at 6:42 PM, Scott Deboy <scott.de...@gmail.com>
>>> wrote:
>>>
>>>> Here you go.
>>>>
>>>> Change the fileURL to apply to your setup, and the name field if you'd
>>>> like and save it as something like chainsaw-log-config.xml.
>>>>
>>>> Open Chainsaw, select File, Load chainsaw configuration menu.
>>>>
>>>> Choose the 'Use a Chainsaw config file' option, and browse to your
>>>> chainsaw-log-config.xml file.  You can also check the 'Always start
>>>> Chainsaw with this configuration' checkbox if you'd like to not go
>>>> through this prompt again.
>>>>
>>>> You can also start Chainsaw with a specific config - just pass the
>>>> path to the config as an arg to Chainsaw's binary.  Something like:
>>>>
>>>> JAVA_OPTS="-Xmx16384M" $HOME/bin/chainsaw
>>>> file:/home/scott/chainsaw-log-config.xml
>>>>
>>>> Reduce -Xmx if your machine has less memory.
>>>>
>>>> Scott
>>>>
>>>>
>>>>
>>>> Config file:
>>>>
>>>> >>> xmlns:log4j="http://jakarta.apache.org/log4j/; debug="true">
>>>>>>> name="Example-receiver">
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>> 
>>>>
>>>>
>>>>
>>>> On 4/21/17, Mohit Garg <mohi...@vt.edu> wrote:
>>>>> Hey Scott,
>>>>>
>>>>> Chunk of my log file:
>>>>>
>>>>> 17:18:24.897 [main] WARN  org.jgroups.protocols.UDP JGRP15: the
>>>>> send
>>>>> buffer of socket MulticastSocket was set to 5MB, but the OS only
>>>> allocated
>>>>> 1.05MB. This might lead to performance problems. Please set your max
>>>>> send
>>>>> buffer in the OS correctly (e.g. net.core.wmem_max on Linux)
>>>>> 17:18:24.897 [main] WARN  org.jgroups.protocols.UDP JGRP000015: the
>>>>> send
>>>>> buffer of socket MulticastSocket was set to 5MB, but the OS only
>>>> allocated
>>>>> 1.05MB. This might lead to performance problems. Please set your max
>>>>> send
>>>>> buffer in the OS correctly (e.g. net.core.wmem_max on Linux)
>>>>> 17:18:24.899 [main] WARN  org.jgroups.protocols.UDP JGRP15: the
>>>>> send
>>>>> buffer of socket MulticastSocket was set to 5MB, but the OS only
>>>> allocated
>>>>> 1.05MB. This might lead to performance problems. Please set your max
>>>>> send
>>>>> buffer in the OS correctly (e.g. net.core.wmem_max on Linux)
>>>>>
>>>>>
>>>>> My Log4J configuration:
>>>>>
>>>>> 
>>>>> 
>>>>>
>>>>>
>>>>>   
>>>>>
>>>>>>>>> bufferedIO="false" advertiseURI="file:///home/user/output.log"
>>>>> advertise="true">
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>&

Re: Chainsaw Zeroconf FileAppender Error

2017-04-21 Thread Scott Deboy
Are you using the developer snapshot at

http://people.apache.org/~sdeboy

This stuff only works with this version.

Scott

On 4/21/17, Mohit Garg <mohi...@vt.edu> wrote:
> Hey Scott,
>
> I got the following error:
>
> Could not instantiate object of class
> [org.apache.log4j.chainsaw.vfs.VFSLogFilePatternReceiver]
> Could not create a plugin. Reported error follows.
> In ParamAction setting parameter [appendNonMatches] to value [true]
> In ParamAction setting parameter [autoReconnect] to value [false]
> In ParamAction setting parameter [fileURL] to value
> [file://home/mohit/example.log]
> and so on for all other parameters
>
> On Fri, Apr 21, 2017 at 6:42 PM, Scott Deboy <scott.de...@gmail.com> wrote:
>
>> Here you go.
>>
>> Change the fileURL to apply to your setup, and the name field if you'd
>> like and save it as something like chainsaw-log-config.xml.
>>
>> Open Chainsaw, select File, Load chainsaw configuration menu.
>>
>> Choose the 'Use a Chainsaw config file' option, and browse to your
>> chainsaw-log-config.xml file.  You can also check the 'Always start
>> Chainsaw with this configuration' checkbox if you'd like to not go
>> through this prompt again.
>>
>> You can also start Chainsaw with a specific config - just pass the
>> path to the config as an arg to Chainsaw's binary.  Something like:
>>
>> JAVA_OPTS="-Xmx16384M" $HOME/bin/chainsaw
>> file:/home/scott/chainsaw-log-config.xml
>>
>> Reduce -Xmx if your machine has less memory.
>>
>> Scott
>>
>>
>>
>> Config file:
>>
>> > xmlns:log4j="http://jakarta.apache.org/log4j/; debug="true">
>> > name="Example-receiver">
>> 
>> 
>> 
>> 
>> 
>> 
>> 
>> 
>> 
>> 
>> 
>>
>>
>>
>> On 4/21/17, Mohit Garg <mohi...@vt.edu> wrote:
>> > Hey Scott,
>> >
>> > Chunk of my log file:
>> >
>> > 17:18:24.897 [main] WARN  org.jgroups.protocols.UDP JGRP15: the
>> > send
>> > buffer of socket MulticastSocket was set to 5MB, but the OS only
>> allocated
>> > 1.05MB. This might lead to performance problems. Please set your max
>> > send
>> > buffer in the OS correctly (e.g. net.core.wmem_max on Linux)
>> > 17:18:24.897 [main] WARN  org.jgroups.protocols.UDP JGRP15: the
>> > send
>> > buffer of socket MulticastSocket was set to 5MB, but the OS only
>> allocated
>> > 1.05MB. This might lead to performance problems. Please set your max
>> > send
>> > buffer in the OS correctly (e.g. net.core.wmem_max on Linux)
>> > 17:18:24.899 [main] WARN  org.jgroups.protocols.UDP JGRP15: the
>> > send
>> > buffer of socket MulticastSocket was set to 5MB, but the OS only
>> allocated
>> > 1.05MB. This might lead to performance problems. Please set your max
>> > send
>> > buffer in the OS correctly (e.g. net.core.wmem_max on Linux)
>> >
>> >
>> > My Log4J configuration:
>> >
>> > 
>> > 
>> > 
>> > 
>> >
>> > 
>> > > > bufferedIO="false" advertiseURI="file:///home/user/output.log"
>> > advertise="true">
>> > 
>> > 
>> > 
>> > 
>> > 
>> > 
>> > 
>> > 
>> > 
>> > 
>> > 
>> > 
>> >
>> >
>> >
>> > On Fri, Apr 21, 2017 at 5:41 PM, Scott Deboy <scott.de...@gmail.com>
>> wrote:
>> >
>> >> Send a chunk of your log file and I'll give you a config that works.
>> >>
>> >> Scott
>> >>
>> >> On Apr 21, 2017 2:36 PM, "Mohit Garg" <mohi...@vt.edu> wrote:
>> >>
>> >> > Hey Scott,
>> >> >
>> >> > Yes, I am using Chainsaw and logging on the same machine.
>> >> >
>> >> > My OS is Ubuntu 14.04.
>> >> >
>> >> > Can you please send me a sample VFSLogFilePatternReceiver config or
>> >> > point
>> >> > me towards a resource.
>> >> >
>> >> >
>> >> > Thanks,
>> >> > Mohit Garg
>> >> >
>> >> > ​
>> >> >
>> >>
>> >
>> >
>> >
>> > --
>> > Thanks and Regards,
>> > Mohit Garg
>> >
>> > Masters|Computer Engineering
>> > Virginia Polytechnic Institute
>> > and State University
>> >
>> > <+1-540-449-3550>   <https://www.linkedin.com/in/mogarg>
>> > <https://github.com/mogarg>   <http://bit.ly/mogargcv>
>> >
>>
>> -
>> To unsubscribe, e-mail: log4j-user-unsubscr...@logging.apache.org
>> For additional commands, e-mail: log4j-user-h...@logging.apache.org
>>
>>
>
>
> --
> Thanks and Regards,
> Mohit Garg
>
> Masters|Computer Engineering
> Virginia Polytechnic Institute
> and State University
>
> <+1-540-449-3550>   <https://www.linkedin.com/in/mogarg>
> <https://github.com/mogarg>   <http://bit.ly/mogargcv>
>

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



Re: Chainsaw Zeroconf FileAppender Error

2017-04-21 Thread Scott Deboy
Here you go.

Change the fileURL to apply to your setup, and the name field if you'd
like and save it as something like chainsaw-log-config.xml.

Open Chainsaw, select File, Load chainsaw configuration menu.

Choose the 'Use a Chainsaw config file' option, and browse to your
chainsaw-log-config.xml file.  You can also check the 'Always start
Chainsaw with this configuration' checkbox if you'd like to not go
through this prompt again.

You can also start Chainsaw with a specific config - just pass the
path to the config as an arg to Chainsaw's binary.  Something like:

JAVA_OPTS="-Xmx16384M" $HOME/bin/chainsaw
file:/home/scott/chainsaw-log-config.xml

Reduce -Xmx if your machine has less memory.

Scott



Config file:

http://jakarta.apache.org/log4j/; debug="true">















On 4/21/17, Mohit Garg <mohi...@vt.edu> wrote:
> Hey Scott,
>
> Chunk of my log file:
>
> 17:18:24.897 [main] WARN  org.jgroups.protocols.UDP JGRP15: the send
> buffer of socket MulticastSocket was set to 5MB, but the OS only allocated
> 1.05MB. This might lead to performance problems. Please set your max send
> buffer in the OS correctly (e.g. net.core.wmem_max on Linux)
> 17:18:24.897 [main] WARN  org.jgroups.protocols.UDP JGRP15: the send
> buffer of socket MulticastSocket was set to 5MB, but the OS only allocated
> 1.05MB. This might lead to performance problems. Please set your max send
> buffer in the OS correctly (e.g. net.core.wmem_max on Linux)
> 17:18:24.899 [main] WARN  org.jgroups.protocols.UDP JGRP15: the send
> buffer of socket MulticastSocket was set to 5MB, but the OS only allocated
> 1.05MB. This might lead to performance problems. Please set your max send
> buffer in the OS correctly (e.g. net.core.wmem_max on Linux)
>
>
> My Log4J configuration:
>
> 
> 
> 
> 
>
> 
>  bufferedIO="false" advertiseURI="file:///home/user/output.log"
> advertise="true">
>     
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
>
>
>
> On Fri, Apr 21, 2017 at 5:41 PM, Scott Deboy <scott.de...@gmail.com> wrote:
>
>> Send a chunk of your log file and I'll give you a config that works.
>>
>> Scott
>>
>> On Apr 21, 2017 2:36 PM, "Mohit Garg" <mohi...@vt.edu> wrote:
>>
>> > Hey Scott,
>> >
>> > Yes, I am using Chainsaw and logging on the same machine.
>> >
>> > My OS is Ubuntu 14.04.
>> >
>> > Can you please send me a sample VFSLogFilePatternReceiver config or
>> > point
>> > me towards a resource.
>> >
>> >
>> > Thanks,
>> > Mohit Garg
>> >
>> > ​
>> >
>>
>
>
>
> --
> Thanks and Regards,
> Mohit Garg
>
> Masters|Computer Engineering
> Virginia Polytechnic Institute
> and State University
>
> <+1-540-449-3550>   <https://www.linkedin.com/in/mogarg>
> <https://github.com/mogarg>   <http://bit.ly/mogargcv>
>

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



Re: Chainsaw Zeroconf FileAppender Error

2017-04-21 Thread Scott Deboy
Send a chunk of your log file and I'll give you a config that works.

Scott

On Apr 21, 2017 2:36 PM, "Mohit Garg"  wrote:

> Hey Scott,
>
> Yes, I am using Chainsaw and logging on the same machine.
>
> My OS is Ubuntu 14.04.
>
> Can you please send me a sample VFSLogFilePatternReceiver config or point
> me towards a resource.
>
>
> Thanks,
> Mohit Garg
>
> ​
>


Re: Chainsaw Zeroconf FileAppender Error

2017-04-21 Thread Scott Deboy
You're using Chainsaw and logging on the same machine?

What OS?

You could just set up a VFSLogFilePatternReceiver config - it'd tail
whatever's available.

Scott

On 4/21/17, Mohit Garg <mohi...@vt.edu> wrote:
> Hey Scott,
>
> I tried with this configuration. However, it still shows the same error.
>
> Attempting connection to 10.1.1.130
> Remote host 10.1.1.130 refused connection
> waiting for 3 millisecond before reconnecting
>
> Thanks,
> Mohit Garg
>
> On Wed, Apr 19, 2017 at 1:22 AM, Scott Deboy <scott.de...@gmail.com> wrote:
>
>> I used jmdns 3.4.2 with the latest log4j2 and a sample app that used
>> the following appender configuration to log to a local file.  Chainsaw
>> was able to discover the advertisement and live tail the log file.
>>
>> It looks like the latest JmDNS has changed their API, so log4j2 works
>> with jmdns 3.4.1, not their latest, right now.
>>
>> Example appender config:
>>
>> 
>> 
>>   
>> 
>> 
>> 
>> > bufferedIO="false" advertiseURI="file://Users/admin/log4j2-output.log"
>> advertise="true">
>> 
>> %d{HH:mm:ss.SSS} [%t] %-5level %logger{36} -
>> %m%n
>> 
>> 
>>   
>>   
>> 
>>   
>> 
>>   
>> 
>>
>> In Chainsaw's 'connect to' menu, I had a 'File1 option'.  I clicked on
>> it, and a new tab opened with the contents of the file - it's
>> live-tailing the log file.
>>
>> On the appender config, advertiseURI could be an ssh endpoint, using
>> Apache Commons VFS 'sftp' support, instead of a 'file://' URI.  For
>> example, if you can ssh from your env running Chainsaw to the app
>> performing the logging, you could use an advertiseURI of something
>> like:
>>
>> sftp://username:password@hostname/Users/admin/log4j2-output.log
>>
>>
>>
>> On 4/18/17, Mohit Garg <mohi...@vt.edu> wrote:
>> > -- Forwarded message --
>> > From: Mohit Garg <mohi...@vt.edu>
>> > Date: Tue, Apr 18, 2017 at 10:24 PM
>> > Subject: Chainsaw Zeroconf FileAppender Error
>> > To: log4j-user@logging.apache.org
>> >
>> >
>> > Hi,
>> >
>> > I am using Apache Chainsaw on an Ubuntu 14.04 machine. In my Java
>> > application I have the advertised my FileAppender URI as follows:
>> >
>> > > > advertiseURI="file:///path/to/output.log" advertise="true">
>> > 
>> > 
>> >
>> > In Zeroconf tab of Chainsaw I can see the Appender File1. However, when
>> > i
>> > try to connect to it I continuously get the following error.
>> >
>> > Failed to connect to remote host 
>> > Reconnecting in 3000 ms
>> >
>> > ---and so on
>> >
>> >
>> > --
>> > Thanks and Regards,
>> > Mohit Garg
>> >
>> > Masters|Computer Engineering
>> > Virginia Polytechnic Institute
>> > and State University
>> >
>> > <+1-540-449-3550>   <https://www.linkedin.com/in/mogarg>
>> > <https://github.com/mogarg>   <http://bit.ly/mogargcv>
>> >
>> >
>> >
>> >
>> > --
>> > Thanks and Regards,
>> > Mohit Garg
>> >
>> > Masters|Computer Engineering
>> > Virginia Polytechnic Institute
>> > and State University
>> >
>> > <+1-540-449-3550>   <https://www.linkedin.com/in/mogarg>
>> > <https://github.com/mogarg>   <http://bit.ly/mogargcv>
>> >
>>
>> -
>> To unsubscribe, e-mail: log4j-user-unsubscr...@logging.apache.org
>> For additional commands, e-mail: log4j-user-h...@logging.apache.org
>>
>>
>
>
> --
> Thanks and Regards,
> Mohit Garg
>
> Masters|Computer Engineering
> Virginia Polytechnic Institute
> and State University
>
> <+1-540-449-3550>   <https://www.linkedin.com/in/mogarg>
> <https://github.com/mogarg>   <http://bit.ly/mogargcv>
>

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



Re: Chainsaw Zeroconf FileAppender Error

2017-04-18 Thread Scott Deboy
I used jmdns 3.4.2 with the latest log4j2 and a sample app that used
the following appender configuration to log to a local file.  Chainsaw
was able to discover the advertisement and live tail the log file.

It looks like the latest JmDNS has changed their API, so log4j2 works
with jmdns 3.4.1, not their latest, right now.

Example appender config:



  





%d{HH:mm:ss.SSS} [%t] %-5level %logger{36} - 
%m%n


  
  

  

  


In Chainsaw's 'connect to' menu, I had a 'File1 option'.  I clicked on
it, and a new tab opened with the contents of the file - it's
live-tailing the log file.

On the appender config, advertiseURI could be an ssh endpoint, using
Apache Commons VFS 'sftp' support, instead of a 'file://' URI.  For
example, if you can ssh from your env running Chainsaw to the app
performing the logging, you could use an advertiseURI of something
like:

sftp://username:password@hostname/Users/admin/log4j2-output.log



On 4/18/17, Mohit Garg  wrote:
> -- Forwarded message --
> From: Mohit Garg 
> Date: Tue, Apr 18, 2017 at 10:24 PM
> Subject: Chainsaw Zeroconf FileAppender Error
> To: log4j-user@logging.apache.org
>
>
> Hi,
>
> I am using Apache Chainsaw on an Ubuntu 14.04 machine. In my Java
> application I have the advertised my FileAppender URI as follows:
>
>  advertiseURI="file:///path/to/output.log" advertise="true">
> 
> 
>
> In Zeroconf tab of Chainsaw I can see the Appender File1. However, when i
> try to connect to it I continuously get the following error.
>
> Failed to connect to remote host 
> Reconnecting in 3000 ms
>
> ---and so on
>
>
> --
> Thanks and Regards,
> Mohit Garg
>
> Masters|Computer Engineering
> Virginia Polytechnic Institute
> and State University
>
> <+1-540-449-3550>   
>    
>
>
>
>
> --
> Thanks and Regards,
> Mohit Garg
>
> Masters|Computer Engineering
> Virginia Polytechnic Institute
> and State University
>
> <+1-540-449-3550>   
>    
>

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



Re: Apache chainsaw

2017-04-09 Thread Scott Deboy
If anyone wants a list of chainsaw features I'd be happy to provide it.
It's much more powerful than just a viewer.

Scott

On Apr 9, 2017 7:59 PM, "John Lussmyer"  wrote:

> On Sun Apr 09 19:01:43 PDT 2017 boa...@gmail.com said:
> >Kibana requires a lot of setup, too. That's more useful for making
> >dashboards for ops in my experience. Having a program I can use to look at
> >logs that's more advanced than tail would be nice. Kind of like Console in
> >macOS.
>
> Kedit is really good for looking at log files.
>
>
> --
>
> Tigers prowl and Dragons soar in my dreams...
>
>
> -
> To unsubscribe, e-mail: log4j-user-unsubscr...@logging.apache.org
> For additional commands, e-mail: log4j-user-h...@logging.apache.org
>


Re: Apache chainsaw

2017-04-09 Thread Scott Deboy
No, not at all  the two devs who worked on it moved on with their lives:)

I still work on it occasionally.

It has a ton of features, I'm not sure Kibana has many of them.

Scott

On Apr 9, 2017 5:12 PM, "DiFrango, Ronald" <ronald.difra...@capitalone.com>
wrote:

> I’m wondering if in part Chainsaw died because of the ELK stack?
>
> Ron DiFrango
>
>
>
> On 4/9/17, 3:56 AM, "Robert Lu" <robberp...@gmail.com> wrote:
>
> Hi, all.
>
> I think developer need a tool to view, search log. Chainsaw was a great
> tool, but need update.
>
> I want to contribute to Chainsaw.
>
> On Sat, Apr 8, 2017 at 10:25 AM, Ralph Goers <
> ralph.go...@dslextreme.com>
> wrote:
>
> > Brett and Robert, are you suggesting you would want to get involved
> in
> > improving Chainsaw if it moved to git?
> >
> > Ralph
> >
> > > On Apr 7, 2017, at 6:42 PM, Brett Randall <javabr...@gmail.com>
> wrote:
> > >
> > > +1 for migration to Git.
> > >
> > > On 6 April 2017 at 07:44, Matt Sicker <boa...@gmail.com> wrote:
> > >
> > >> We can probably do that, though usually we like to do a 72 hour
> grace
> > >> period to make sure there are no objections before migrating
> > repositories.
> > >>
> > >> On 6 April 2017 at 02:01, Robert Lu <robberp...@gmail.com> wrote:
> > >>
> > >>> Can chainsaw migrate to git?
> > >>>
> > >>> On Thu, Mar 30, 2017 at 4:04 AM, Matt Sicker <boa...@gmail.com>
> wrote:
> > >>>
> > >>>> You need to use the new home.apache.org site for uploading
> things now
> > >>>> anyways. Who knows how long they'll keep the old server online.
> If we
> > >> set
> > >>>> it up in Jenkins, we can also have snapshots published to Nexus.
> > >>>>
> > >>>> On 29 March 2017 at 14:53, Ralph Goers <
> ralph.go...@dslextreme.com>
> > >>> wrote:
> > >>>>
> > >>>>> We can’t be pointing people to use snapshots from your
> personal page.
> > >>> I’m
> > >>>>> not even sure how you can publish there any more.  Can’t you
> do a
> > >>> release
> > >>>>> if there are features that you use?  It would be nice to at
> least say
> > >>> it
> > >>>>> supports Log4j 2 and how to set it up.
> > >>>>>
> > >>>>> Ralph
> > >>>>>
> > >>>>>> On Mar 29, 2017, at 12:30 PM, Scott Deboy <
> scott.de...@gmail.com>
> > >>>> wrote:
> > >>>>>>
> > >>>>>> I use it and it works well for logs under 1M records,
> assuming you
> > >>> can
> > >>>>>> give the JVM enough memory.
> > >>>>>>
> > >>>>>> I use the developer snapshot here:
> > >>>>>>
> > >>>>>> https://people.apache.org/~sdeboy/
> > >>>>>>
> > >>>>>>
> > >>>>>> On 3/29/17, João Ferreira <ferreirinha...@hotmail.com> wrote:
> > >>>>>>> Yeah, that was what i expected. But is there any project
> replacing
> > >>>> this
> > >>>>>>> one?
> > >>>>>>>
> > >>>>>>> Wednesday, 29 March 2017, 08:01PM +01:00 from Igal @
> Lucee.org
> > >>>>>>> i...@lucee.org<mailto:i...@lucee.org>:
> > >>>>>>>
> > >>>>>>> https://logging.apache.org/chainsaw/changes-report.html
> > >>>>>>> Last Published: 09/01/2007
> > >>>>>>>
> > >>>>>>> Id say its not active.
> > >>>>>>>
> > >>>>>>> Igal Sapir
> > >>>>>>> Lucee Core Developer
> > >>>>>>> Lucee.org <http://lucee.org/>
> > >>>>>>>
> > >>>>>>> On 3/29/2017 11:56 AM, João Ferreira wrote:
> > >>>>>>>> Hello,
> >

Re: Re[2]: Apache chainsaw

2017-03-29 Thread Scott Deboy
I use it and it works well for logs under 1M records, assuming you can
give the JVM enough memory.

I use the developer snapshot here:

https://people.apache.org/~sdeboy/


On 3/29/17, João Ferreira  wrote:
> Yeah, that was what i expected. But is there any project replacing this
> one?
>
> Wednesday, 29 March 2017, 08:01PM +01:00 from Igal @ Lucee.org
> i...@lucee.org:
>
> https://logging.apache.org/chainsaw/changes-report.html
> Last Published: 09/01/2007
>
> Id say its not active.
>
> Igal Sapir
> Lucee Core Developer
> Lucee.org 
>
> On 3/29/2017 11:56 AM, João Ferreira wrote:
>> Hello,
>>
>> Is apache chainsaw still an active project? If not, was it replaced by
>> another project?
>>
>> Best regards
>> Joao
>>
>
>

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



Re: Is Chainsaw alive?

2017-01-16 Thread Scott Deboy
The developer snapshot tarball works for me.

Available at http://people.apache.org/~sdeboy/

On Jan 16, 2017 3:43 AM, "Robert Lu"  wrote:

> Hi,
>
> Cloud you please compile Chainsaw for macOS Sierra?
>
>
>
>
> -
> To unsubscribe, e-mail: log4j-user-unsubscr...@logging.apache.org
> For additional commands, e-mail: log4j-user-h...@logging.apache.org
>
>


Re: chainsaw - socket hander - jdk util logging

2016-05-16 Thread Scott Deboy
Chainsaw config files are regular log4j config files.

Plugins are receivers, but you can just add any log4j appender to that same
chainsaw config and it will send the received events to the appender, like
a rollingfileappender.

Scott
On May 16, 2016 7:44 PM, "Ray Tayek" <rta...@ca.rr.com> wrote:

> On 5/16/2016 5:11 PM, Scott Deboy wrote:
>
>> I just tried it myself with the latest developer snapshot and it worked
>> fine.
>>
>> This code was used on the 'transmit' side: ...
>>
> i use similar code.
>
>> This config file was my entire Chainsaw config (started on same
>> machine of course):
>>
>> 
>> http://jakarta.apache.org/log4j/;
>> debug="true">
>> > class="org.apache.log4j.net.XMLSocketReceiver">
>>> value="org.apache.log4j.xml.UtilLoggingXMLDecoder"/>
>>
>> 
>> 
>>
>> 
>> 
>>
> got a bind exception, and killed the other version.
>
> seems to work fine now. all the stuff is in it's own tab with all the
> headers for the columns.
>
> so that's a lot of progress.
>
> will chainsaw write the log records to a file and roll it over?
>
> i expect to receive data from a dozen or so devices.
>
> thanks
>
> On 5/16/16, Ray Tayek <rta...@ca.rr.com> wrote:
>>
>>> On 5/16/2016 2:26 PM, Scott Deboy wrote:
>>>
>>>> With the latest developer snapshot from
>>>> http://people.apache.org/~sdeboy
>>>>
>>>> See the 'Welcome' tab in Chainsaw, and click 'View example Receiver
>>>> Configuration' toolbar button.
>>>>
>>>> Copy and paste that to a file, and remove all of the plugin entries
>>>> except
>>>> for:
>>>>
>>>>>>> class="org.apache.log4j.net.XMLSocketReceiver">
>>>> >>> value="org.apache.log4j.xml.UtilLoggingXMLDecoder"/>
>>>> 
>>>>  
>>>>
>>>> And modify that port to match what you need, and save as
>>>> chainsaw-config-util-logging-socket.xml or something like that.
>>>>
>>>> Then, in Chainsaw, select File, Load Chainsaw configuration, use a
>>>> Chainsaw config file, open file, browse to that
>>>> chainsaw-config-util-logging-socket.xml file, and click ok.
>>>>
>>>> You should start seeing your events show up in the UI.
>>>>
>>> tried that with the attached file. but it just says: 56 - 2016/05/16
>>> 15:53:09 -  - INFO - org.apache.log4j.chainsaw.messages.MessageCenter -
>>> getXMLFileAppenderConfiguration for file:
>>> C:\Users\ray\Documents\chainsawconfig.xml, result: {}
>>>
>>> i tried using this file with my older version (2.1) and it started the
>>> socket, and i am seeing lots of messages! (thank you)
>>>
>>> but the messages are not expanded, as they are in the chainsaw log tab
>>> (there are only 3 columns: application, hostname, and
>>> log4j.remoteSourceInfo).
>>>
>>> is there a way to make the messages show up with the usual column
>>> headings like the pic <https://logging.apache.org/chainsaw/> in the doc?
>>>
>>> it says my buffer is full, is there a way to store these as files and
>>> roll them over at some point?
>>>
>>> doc says: *Tabs/Docking* - Chainsaw routes separate applications/remote
>>> hosts' events to a unique Tab within the GUI. These tabs can be undocked
>>> from the main window. Using these features you can manage multiple
>>> application logs using the one GUI. can you point me to the doc on this?
>>>
>>> thanks
>>>
>>>
>>> On 5/16/16, Ray Tayek <rta...@ca.rr.com> wrote:
>>>>
>>>>> hi,  please excuse me if this is the wrong place to post, but i am new
>>>>> to log4j and chainsaw.
>>>>>
>>>>> i posted this question
>>>>> <
>>>>> http://stackoverflow.com/questions/37239400/apache-chainsaw-v2-gets-bind-exception-or-connection-lost-invalid-stream-he
>>>>> >,
>>>>>
>>>>> but have no results yet.
>>>>>
>>>>> jigsaw seems kinda dead, is this what people still use to monitor logs
>>>>> from socket handlers or should i look at something more recent?
>>>>>
>>>>> any pointers will be appreciated.
>>>>>
>>>>>
>>>>> ...
>
>
> --
> Honesty is a very expensive gift. So, don't expect it from cheap people -
> Warren Buffett
> http://tayek.com/
>
>


Re: chainsaw - socket hander - jdk util logging

2016-05-16 Thread Scott Deboy
I just tried it myself with the latest developer snapshot and it worked fine.

This code was used on the 'transmit' side:

SocketHandler socketHandler = new SocketHandler("localhost", );
logger.addHandler(socketHandler);
socketHandler.setLevel(Level.ALL);
logger.setLevel(Level.ALL);

This config file was my entire Chainsaw config (started on same
machine of course):


http://jakarta.apache.org/log4j/;
debug="true">
   
  
  
   
   
  
   


The levels fine/finer/finest showed up fine, and the message and
timestamp displayed, even throwable showed up fine.

Events should route to their own tab, see the 'application-wide
preferences', general, tab name/event routing expression field.  By
default the 'hostname' and 'application' fields are used to route
events to unique tabs.  Application isn't set, but hostname should be
'localhost', so events should go to a 'localhost' tab.

You can right-click in a table and go to tab preferences and select
displayed columns.

The tutorial is most of the documentation we have (available from the
help menu), but the 'tab routing' expression is based on fields found
in the log event itself, which is why 'hostname' is set to localhost
for the socket handler events.  You could change that expression to
'level' to get individual tabs for info/debug/warn level messages,
etc.

I hope that helps,

Scott




On 5/16/16, Ray Tayek <rta...@ca.rr.com> wrote:
> On 5/16/2016 2:26 PM, Scott Deboy wrote:
>> With the latest developer snapshot from http://people.apache.org/~sdeboy
>>
>> See the 'Welcome' tab in Chainsaw, and click 'View example Receiver
>> Configuration' toolbar button.
>>
>> Copy and paste that to a file, and remove all of the plugin entries except
>> for:
>>
>>   > class="org.apache.log4j.net.XMLSocketReceiver">
>>> value="org.apache.log4j.xml.UtilLoggingXMLDecoder"/>
>>
>> 
>>
>> And modify that port to match what you need, and save as
>> chainsaw-config-util-logging-socket.xml or something like that.
>>
>> Then, in Chainsaw, select File, Load Chainsaw configuration, use a
>> Chainsaw config file, open file, browse to that
>> chainsaw-config-util-logging-socket.xml file, and click ok.
>>
>> You should start seeing your events show up in the UI.
> tried that with the attached file. but it just says: 56 - 2016/05/16
> 15:53:09 -  - INFO - org.apache.log4j.chainsaw.messages.MessageCenter -
> getXMLFileAppenderConfiguration for file:
> C:\Users\ray\Documents\chainsawconfig.xml, result: {}
>
> i tried using this file with my older version (2.1) and it started the
> socket, and i am seeing lots of messages! (thank you)
>
> but the messages are not expanded, as they are in the chainsaw log tab
> (there are only 3 columns: application, hostname, and
> log4j.remoteSourceInfo).
>
> is there a way to make the messages show up with the usual column
> headings like the pic <https://logging.apache.org/chainsaw/> in the doc?
>
> it says my buffer is full, is there a way to store these as files and
> roll them over at some point?
>
> doc says: *Tabs/Docking* - Chainsaw routes separate applications/remote
> hosts' events to a unique Tab within the GUI. These tabs can be undocked
> from the main window. Using these features you can manage multiple
> application logs using the one GUI. can you point me to the doc on this?
>
> thanks
>
>
>
>
>
>
>> On 5/16/16, Ray Tayek <rta...@ca.rr.com> wrote:
>>> hi,  please excuse me if this is the wrong place to post, but i am new
>>> to log4j and chainsaw.
>>>
>>> i posted this question
>>> <http://stackoverflow.com/questions/37239400/apache-chainsaw-v2-gets-bind-exception-or-connection-lost-invalid-stream-he>,
>>>
>>> but have no results yet.
>>>
>>> jigsaw seems kinda dead, is this what people still use to monitor logs
>>> from socket handlers or should i look at something more recent?
>>>
>>> any pointers will be appreciated.
>>>
>>> thanks
>>>
>>> --
>>> Honesty is a very expensive gift. So, don't expect it from cheap people
>>> -
>>> Warren Buffett
>>> http://tayek.com/
>>>
>>>
>> -
>> To unsubscribe, e-mail: log4j-user-unsubscr...@logging.apache.org
>> For additional commands, e-mail: log4j-user-h...@logging.apache.org
>>
>>
>
>
> --
> Honesty is a very expensive gift. So, don't expect it from cheap people -
> Warren Buffett
> http://tayek.com/
>
>

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



Re: chainsaw - socket hander - jdk util logging

2016-05-16 Thread Scott Deboy
With the latest developer snapshot from http://people.apache.org/~sdeboy

See the 'Welcome' tab in Chainsaw, and click 'View example Receiver
Configuration' toolbar button.

Copy and paste that to a file, and remove all of the plugin entries except for:

 
  
  
   

And modify that port to match what you need, and save as
chainsaw-config-util-logging-socket.xml or something like that.

Then, in Chainsaw, select File, Load Chainsaw configuration, use a
Chainsaw config file, open file, browse to that
chainsaw-config-util-logging-socket.xml file, and click ok.

You should start seeing your events show up in the UI.

Scott

On 5/16/16, Ray Tayek  wrote:
> hi,  please excuse me if this is the wrong place to post, but i am new
> to log4j and chainsaw.
>
> i posted this question
> ,
>
> but have no results yet.
>
> jigsaw seems kinda dead, is this what people still use to monitor logs
> from socket handlers or should i look at something more recent?
>
> any pointers will be appreciated.
>
> thanks
>
> --
> Honesty is a very expensive gift. So, don't expect it from cheap people -
> Warren Buffett
> http://tayek.com/
>
>

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



Re: Zero conf is not showing logs even it's connected

2016-03-07 Thread Scott Deboy
I'll need to dig in to this.  The advertiserURI isn't coming across
for some reason.

Scott


On 3/7/16, Bilguun Ariunbold <ariunboldbilig...@gmail.com> wrote:
> Thanks Scott, I've used the developer snapshot that you mentioned but still
> no luck. If you see the screen shot that I attached, WS00943 is my
> machine's local domain, smdi.com is network's domain, 10.20.91.29 is my
> machine's ip address. It seems like it's trying to connect to
> WS00943.smdi.com/10.20.91.29:4555. Is that the way it supposed to be? When
> I double click on the entry at ZeroConf tab, it still just changes the
> connection status to Connected/Not Connected. Was I supposed to see the
> logs when I double click on that row at ZeroConf tab?
>
> http://stackoverflow.com/questions/35784129/how-to-configure-port-in-apache-chainsaw-with-log4j2
>
> On Fri, Mar 4, 2016 at 10:13 PM, Scott Deboy <scott.de...@gmail.com> wrote:
>
>> To clarify, the 'people' path is going away - the new permanent path is:
>>
>> http://home.apache.org/~sdeboy
>>
>>
>> On 3/4/16, Scott Deboy <scott.de...@gmail.com> wrote:
>> > I've uploaded the developer snapshot to
>> http://people.apache.org/~sdeboy/
>> >
>> > Extract the tarball and run bin/chainsaw
>> >
>> > It should work out-of-the-box with your current configuration.
>> >
>> > Scott
>> >
>> >
>> > On 3/4/16, Matt Sicker <boa...@gmail.com> wrote:
>> >> Oh no they finally shut down people.apache.org!
>> >>
>> >> On 4 March 2016 at 14:36, Bilguun Ariunbold <
>> ariunboldbilig...@gmail.com>
>> >> wrote:
>> >>
>> >>> Thank you Scott, the link you sent me was not found. Where should I
>> >>> get
>> >>> that snapshot?
>> >>>
>> >>> On Fri, Mar 4, 2016 at 3:33 PM, Scott Deboy <scott.de...@gmail.com>
>> >>> wrote:
>> >>>
>> >>> > You need to use the latest developer snapshot of chainsaw to work
>> with
>> >>> > log4j2. Need to see if it is still on
>> http://people.apache.org/~sdeboy
>> >>> > On Mar 4, 2016 12:18 PM, "Bilguun Ariunbold" <
>> >>> ariunboldbilig...@gmail.com>
>> >>> > wrote:
>> >>> >
>> >>> > > Okay, let me clarify this. I am using chainsawWebStart.jnlp to
>> start
>> >>> > > chainsaw and I choose "Let me define Receivers manually" when it
>> >>> > complained
>> >>> > > "Warning:You have no Receivers defined...".
>> >>> > > When I double click on a row in Zeroconf tab, it just changes
>> >>> connection
>> >>> > > status to Connected/Not Connected. So, when I click chainsaw-log
>> >>> > > tab,
>> >>> > below
>> >>> > > messages are repeated there as a grid:
>> >>> > >
>> >>> > > Attempting connection to 10.20.91.2/which is my machine's ip
>> >>> > > address/
>> >>> > > Remote host 10.20.91.29 refused connection.
>> >>> > > waiting for 3 milliseconds before reconnection
>> >>> > >
>> >>> > >
>> >>> > >
>> >>> > > My machine is Windows pc. Was I supposed to be administrator of
>> >>> > > my
>> >>> > > machine? I don't need log4j-zeroconf.jar, do I?
>> >>> > >
>> >>> > >
>> >>> > > Thanks
>> >>> > >
>> >>> > >
>> >>> > >
>> >>> > >
>> >>> > >
>> >>> > >
>> >>> > > On Fri, Mar 4, 2016 at 3:00 PM, Scott Deboy
>> >>> > > <scott.de...@gmail.com
>> >
>> >>> > wrote:
>> >>> > >
>> >>> > > > I don't know why it would say remote host refused connection.
>> Are
>> >>> > > > there any other errors or warnings in the chainsaw-log tab
>> >>> > > > generated
>> >>> > > > when you double-click the zeroconf entry?
>> >>> > > >
>> >>> > > > On 3/4/16, Bilguun Ariunbold <ariunboldbilig...@gmail.com>
>> wrote:
>> >>> > > > > Hi Scott,
>> >>> > > > 

Re: Zero conf is not showing logs even it's connected

2016-03-04 Thread Scott Deboy
I've uploaded the developer snapshot to http://people.apache.org/~sdeboy/

Extract the tarball and run bin/chainsaw

It should work out-of-the-box with your current configuration.

Scott


On 3/4/16, Matt Sicker <boa...@gmail.com> wrote:
> Oh no they finally shut down people.apache.org!
>
> On 4 March 2016 at 14:36, Bilguun Ariunbold <ariunboldbilig...@gmail.com>
> wrote:
>
>> Thank you Scott, the link you sent me was not found. Where should I get
>> that snapshot?
>>
>> On Fri, Mar 4, 2016 at 3:33 PM, Scott Deboy <scott.de...@gmail.com>
>> wrote:
>>
>> > You need to use the latest developer snapshot of chainsaw to work with
>> > log4j2. Need to see if it is still on http://people.apache.org/~sdeboy
>> > On Mar 4, 2016 12:18 PM, "Bilguun Ariunbold" <
>> ariunboldbilig...@gmail.com>
>> > wrote:
>> >
>> > > Okay, let me clarify this. I am using chainsawWebStart.jnlp to start
>> > > chainsaw and I choose "Let me define Receivers manually" when it
>> > complained
>> > > "Warning:You have no Receivers defined...".
>> > > When I double click on a row in Zeroconf tab, it just changes
>> connection
>> > > status to Connected/Not Connected. So, when I click chainsaw-log tab,
>> > below
>> > > messages are repeated there as a grid:
>> > >
>> > > Attempting connection to 10.20.91.2/which is my machine's ip address/
>> > > Remote host 10.20.91.29 refused connection.
>> > > waiting for 30000 milliseconds before reconnection
>> > >
>> > >
>> > >
>> > > My machine is Windows pc. Was I supposed to be administrator of my
>> > > machine? I don't need log4j-zeroconf.jar, do I?
>> > >
>> > >
>> > > Thanks
>> > >
>> > >
>> > >
>> > >
>> > >
>> > >
>> > > On Fri, Mar 4, 2016 at 3:00 PM, Scott Deboy <scott.de...@gmail.com>
>> > wrote:
>> > >
>> > > > I don't know why it would say remote host refused connection.  Are
>> > > > there any other errors or warnings in the chainsaw-log tab
>> > > > generated
>> > > > when you double-click the zeroconf entry?
>> > > >
>> > > > On 3/4/16, Bilguun Ariunbold <ariunboldbilig...@gmail.com> wrote:
>> > > > > Hi Scott,
>> > > > >
>> > > > > Thank you for your respond.
>> > > > >
>> > > > > Are you running Chainsaw on the same machine as the app using
>> > > > > this
>> > > > > log4j2 appender config?
>> > > > >
>> > > > > -Yes I am, I checked a file by opening through web browsers by
>> > > > advertiseUri
>> > > > > and it was opened successfully. (Once I tested on my local, I'll
>> > > separate
>> > > > > them to the different machines). As far as I know, chainsaw uses
>> 4555
>> > > as
>> > > > > default port, was I supposed to specify different port in my
>> appender
>> > > > > definition?
>> > > > >
>> > > > > On Fri, Mar 4, 2016 at 2:30 PM, Scott Deboy
>> > > > > <scott.de...@gmail.com
>> >
>> > > > wrote:
>> > > > >
>> > > > >> Are you running Chainsaw on the same machine as the app using
>> > > > >> this
>> > > > >> log4j2 appender config?
>> > > > >>
>> > > > >> Chainsaw will try to load the advertiseURL directly:
>> > > > >> file:///C://users/bilguuna/logs/webapp.log
>> > > > >>
>> > > > >> If Chainsaw is on a separate machine, multicast packets need to
>> > > > >> be
>> > > > >> able to flow between your environment using this log4j2 appender
>> and
>> > > > >> Chainsaw, and then the advertiseURL needs to also be accessible
>> from
>> > > > >> Chainsaw.
>> > > > >>
>> > > > >> If you are running this log4j2 ap

Re: Zero conf is not showing logs even it's connected

2016-03-04 Thread Scott Deboy
To clarify, the 'people' path is going away - the new permanent path is:

http://home.apache.org/~sdeboy


On 3/4/16, Scott Deboy <scott.de...@gmail.com> wrote:
> I've uploaded the developer snapshot to http://people.apache.org/~sdeboy/
>
> Extract the tarball and run bin/chainsaw
>
> It should work out-of-the-box with your current configuration.
>
> Scott
>
>
> On 3/4/16, Matt Sicker <boa...@gmail.com> wrote:
>> Oh no they finally shut down people.apache.org!
>>
>> On 4 March 2016 at 14:36, Bilguun Ariunbold <ariunboldbilig...@gmail.com>
>> wrote:
>>
>>> Thank you Scott, the link you sent me was not found. Where should I get
>>> that snapshot?
>>>
>>> On Fri, Mar 4, 2016 at 3:33 PM, Scott Deboy <scott.de...@gmail.com>
>>> wrote:
>>>
>>> > You need to use the latest developer snapshot of chainsaw to work with
>>> > log4j2. Need to see if it is still on http://people.apache.org/~sdeboy
>>> > On Mar 4, 2016 12:18 PM, "Bilguun Ariunbold" <
>>> ariunboldbilig...@gmail.com>
>>> > wrote:
>>> >
>>> > > Okay, let me clarify this. I am using chainsawWebStart.jnlp to start
>>> > > chainsaw and I choose "Let me define Receivers manually" when it
>>> > complained
>>> > > "Warning:You have no Receivers defined...".
>>> > > When I double click on a row in Zeroconf tab, it just changes
>>> connection
>>> > > status to Connected/Not Connected. So, when I click chainsaw-log
>>> > > tab,
>>> > below
>>> > > messages are repeated there as a grid:
>>> > >
>>> > > Attempting connection to 10.20.91.2/which is my machine's ip
>>> > > address/
>>> > > Remote host 10.20.91.29 refused connection.
>>> > > waiting for 3 milliseconds before reconnection
>>> > >
>>> > >
>>> > >
>>> > > My machine is Windows pc. Was I supposed to be administrator of my
>>> > > machine? I don't need log4j-zeroconf.jar, do I?
>>> > >
>>> > >
>>> > > Thanks
>>> > >
>>> > >
>>> > >
>>> > >
>>> > >
>>> > >
>>> > > On Fri, Mar 4, 2016 at 3:00 PM, Scott Deboy <scott.de...@gmail.com>
>>> > wrote:
>>> > >
>>> > > > I don't know why it would say remote host refused connection.  Are
>>> > > > there any other errors or warnings in the chainsaw-log tab
>>> > > > generated
>>> > > > when you double-click the zeroconf entry?
>>> > > >
>>> > > > On 3/4/16, Bilguun Ariunbold <ariunboldbilig...@gmail.com> wrote:
>>> > > > > Hi Scott,
>>> > > > >
>>> > > > > Thank you for your respond.
>>> > > > >
>>> > > > > Are you running Chainsaw on the same machine as the app using
>>> > > > > this
>>> > > > > log4j2 appender config?
>>> > > > >
>>> > > > > -Yes I am, I checked a file by opening through web browsers by
>>> > > > advertiseUri
>>> > > > > and it was opened successfully. (Once I tested on my local, I'll
>>> > > separate
>>> > > > > them to the different machines). As far as I know, chainsaw uses
>>> 4555
>>> > > as
>>> > > > > default port, was I supposed to specify different port in my
>>> appender
>>> > > > > definition?
>>> > > > >
>>> > > > > On Fri, Mar 4, 2016 at 2:30 PM, Scott Deboy
>>> > > > > <scott.de...@gmail.com
>>> >
>>> > > > wrote:
>>> > > > >
>>> > > > >> Are you running Chainsaw on the same machine as the app using
>>> > > > >> this
>>> > > > >> log4j2 appender config?
>>> > > > >>
>>> > > > >> Chainsaw will try to load the advertiseURL directly:
>>> > > > >> file:///C://users/bilguuna/logs/webapp.log
>>> > > > >>
>>> > > > >> If Chainsaw is on a separate machine, multicast packets need to
>>> > > > >> be
>>> > > > >> able to flow between your env

Re: Zero conf is not showing logs even it's connected

2016-03-04 Thread Scott Deboy
You need to use the latest developer snapshot of chainsaw to work with
log4j2. Need to see if it is still on http://people.apache.org/~sdeboy
On Mar 4, 2016 12:18 PM, "Bilguun Ariunbold" <ariunboldbilig...@gmail.com>
wrote:

> Okay, let me clarify this. I am using chainsawWebStart.jnlp to start
> chainsaw and I choose "Let me define Receivers manually" when it complained
> "Warning:You have no Receivers defined...".
> When I double click on a row in Zeroconf tab, it just changes connection
> status to Connected/Not Connected. So, when I click chainsaw-log tab, below
> messages are repeated there as a grid:
>
> Attempting connection to 10.20.91.2/which is my machine's ip address/
> Remote host 10.20.91.29 refused connection.
> waiting for 3 milliseconds before reconnection
>
>
>
> My machine is Windows pc. Was I supposed to be administrator of my
> machine? I don't need log4j-zeroconf.jar, do I?
>
>
> Thanks
>
>
>
>
>
>
> On Fri, Mar 4, 2016 at 3:00 PM, Scott Deboy <scott.de...@gmail.com> wrote:
>
> > I don't know why it would say remote host refused connection.  Are
> > there any other errors or warnings in the chainsaw-log tab generated
> > when you double-click the zeroconf entry?
> >
> > On 3/4/16, Bilguun Ariunbold <ariunboldbilig...@gmail.com> wrote:
> > > Hi Scott,
> > >
> > > Thank you for your respond.
> > >
> > > Are you running Chainsaw on the same machine as the app using this
> > > log4j2 appender config?
> > >
> > > -Yes I am, I checked a file by opening through web browsers by
> > advertiseUri
> > > and it was opened successfully. (Once I tested on my local, I'll
> separate
> > > them to the different machines). As far as I know, chainsaw uses 4555
> as
> > > default port, was I supposed to specify different port in my appender
> > > definition?
> > >
> > > On Fri, Mar 4, 2016 at 2:30 PM, Scott Deboy <scott.de...@gmail.com>
> > wrote:
> > >
> > >> Are you running Chainsaw on the same machine as the app using this
> > >> log4j2 appender config?
> > >>
> > >> Chainsaw will try to load the advertiseURL directly:
> > >> file:///C://users/bilguuna/logs/webapp.log
> > >>
> > >> If Chainsaw is on a separate machine, multicast packets need to be
> > >> able to flow between your environment using this log4j2 appender and
> > >> Chainsaw, and then the advertiseURL needs to also be accessible from
> > >> Chainsaw.
> > >>
> > >> If you are running this log4j2 appender config on a Linux box and
> > >> multicast is available across your network, you would need to use a
> > >> Commons-VFS supported URI in your advertiseURL in order to have
> > >> Chainsaw tail the logs.
> > >>
> > >> Something like this for an advertiseURL:
> > >>
> > >> advertiseURI="sftp://myuser:mypass@hostname/path/to/logfile;
> > >>
> > >>
> > >>
> > >> On 3/4/16, Bilguun Ariunbold <ariunboldbilig...@gmail.com> wrote:
> > >> > Hi,
> > >> >
> > >> >
> > >> >
> > >> > I’ve been trying to see logs using Chainsaw ZeroConf but it is not
> > >> showing
> > >> > me any logs even though it has “Connected” connection status.
> > >> >
> > >> >
> > >> > My workspace:
> > >> >
> > >> > Tomcat 8,
> > >> >
> > >> > Log4j2.5
> > >> >
> > >> > Chainsaw v2
> > >> >
> > >> > I added javax.jmdns:jmdns as a dependency to the project
> > >> >
> > >> >
> > >> > Here is my log4j.xml:
> > >> >
> > >> > 
> > >> >
> > >> > 
> > >> >
> > >> >
> > >> >
> > >> >   %d | %-5p | [%t] | %c{2} |
> %M
> > |
> > >> > %m%n
> > >> >
> > >> >

Re: Zero conf is not showing logs even it's connected

2016-03-04 Thread Scott Deboy
I don't know why it would say remote host refused connection.  Are
there any other errors or warnings in the chainsaw-log tab generated
when you double-click the zeroconf entry?

On 3/4/16, Bilguun Ariunbold <ariunboldbilig...@gmail.com> wrote:
> Hi Scott,
>
> Thank you for your respond.
>
> Are you running Chainsaw on the same machine as the app using this
> log4j2 appender config?
>
> -Yes I am, I checked a file by opening through web browsers by advertiseUri
> and it was opened successfully. (Once I tested on my local, I'll separate
> them to the different machines). As far as I know, chainsaw uses 4555 as
> default port, was I supposed to specify different port in my appender
> definition?
>
> On Fri, Mar 4, 2016 at 2:30 PM, Scott Deboy <scott.de...@gmail.com> wrote:
>
>> Are you running Chainsaw on the same machine as the app using this
>> log4j2 appender config?
>>
>> Chainsaw will try to load the advertiseURL directly:
>> file:///C://users/bilguuna/logs/webapp.log
>>
>> If Chainsaw is on a separate machine, multicast packets need to be
>> able to flow between your environment using this log4j2 appender and
>> Chainsaw, and then the advertiseURL needs to also be accessible from
>> Chainsaw.
>>
>> If you are running this log4j2 appender config on a Linux box and
>> multicast is available across your network, you would need to use a
>> Commons-VFS supported URI in your advertiseURL in order to have
>> Chainsaw tail the logs.
>>
>> Something like this for an advertiseURL:
>>
>> advertiseURI="sftp://myuser:mypass@hostname/path/to/logfile;
>>
>>
>>
>> On 3/4/16, Bilguun Ariunbold <ariunboldbilig...@gmail.com> wrote:
>> > Hi,
>> >
>> >
>> >
>> > I’ve been trying to see logs using Chainsaw ZeroConf but it is not
>> showing
>> > me any logs even though it has “Connected” connection status.
>> >
>> >
>> > My workspace:
>> >
>> > Tomcat 8,
>> >
>> > Log4j2.5
>> >
>> > Chainsaw v2
>> >
>> > I added javax.jmdns:jmdns as a dependency to the project
>> >
>> >
>> > Here is my log4j.xml:
>> >
>> > 
>> >
>> > 
>> >
>> >
>> >
>> >   %d | %-5p | [%t] | %c{2} | %M |
>> > %m%n
>> >
>> >   
>> >
>> >
>> >
>> >
>> >
>> >   
>> >
>> >  
>> >
>> >   
>> >
>> >   > > *"${sys:user.home}/logs/webapp-errors.log"*
>> >
>> >  filePattern=
>> > *"${sys:user.home}/logs/webapp-errors-%d{-MM-dd}-%i.log"*>
>> >
>> >  
>> >
>> >
>> >
>> >
>> >
>> >  
>> >
>> >  
>> >
>> >  
>> >
>> >  
>> >
>> >   
>> >
>> >   > > *"${sys:user.home}/logs/webapp.log"*
>> >
>> >  filePattern=
>> > *"${sys:user.home}/logs/webapp-%d{-MM-dd}-%i.log"*
>> >
>> >  bufferedIO=*"false"* advertiseURI=
>> > *"file:///C://users/bilguuna/logs/webapp.log"*
>> >
>> >  advertise=*"true"*>
>> >
>> >  
>> >
>> >  
>> >
>> >
>> >
>> >
>> >
>> >  
>> >
>> >  
>> >
>> >   
>> >
>> >
>> >
>> >
>> >
>> >   
>> >
>> >  
>> >
>> >  
>> >
>> >  
>> >
>> >   
>> >
>> >
>> >
>> > 
>> >
>> >
>> > On the ZeroConf tab, I see 2 receivers which are configuration and
>> LogFile
>> > that both are connected. When I double click any of them, it just
>> > changes
>> > Connection status but not showing any logs. What should I do?
>> >
>> >
>> > Update: I realized that in zeroconf folder of the chainsaw-log tab, it
>> said
>> > Remote host [10.20.91.20] refused connection. Is that might be the
>> reason?
>> >
>> >
>> > Thank you
>> >
>>
>> -
>> To unsubscribe, e-mail: log4j-user-unsubscr...@logging.apache.org
>> For additional commands, e-mail: log4j-user-h...@logging.apache.org
>>
>>
>

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



Re: Zero conf is not showing logs even it's connected

2016-03-04 Thread Scott Deboy
Are you running Chainsaw on the same machine as the app using this
log4j2 appender config?

Chainsaw will try to load the advertiseURL directly:
file:///C://users/bilguuna/logs/webapp.log

If Chainsaw is on a separate machine, multicast packets need to be
able to flow between your environment using this log4j2 appender and
Chainsaw, and then the advertiseURL needs to also be accessible from
Chainsaw.

If you are running this log4j2 appender config on a Linux box and
multicast is available across your network, you would need to use a
Commons-VFS supported URI in your advertiseURL in order to have
Chainsaw tail the logs.

Something like this for an advertiseURL:

advertiseURI="sftp://myuser:mypass@hostname/path/to/logfile;



On 3/4/16, Bilguun Ariunbold  wrote:
> Hi,
>
>
>
> I’ve been trying to see logs using Chainsaw ZeroConf but it is not showing
> me any logs even though it has “Connected” connection status.
>
>
> My workspace:
>
> Tomcat 8,
>
> Log4j2.5
>
> Chainsaw v2
>
> I added javax.jmdns:jmdns as a dependency to the project
>
>
> Here is my log4j.xml:
>
> 
>
> 
>
>
>
>   %d | %-5p | [%t] | %c{2} | %M |
> %m%n
>
>   
>
>
>
>
>
>   
>
>  
>
>   
>
>*"${sys:user.home}/logs/webapp-errors.log"*
>
>  filePattern=
> *"${sys:user.home}/logs/webapp-errors-%d{-MM-dd}-%i.log"*>
>
>  
>
>
>
>
>
>  
>
>  
>
>  
>
>  
>
>   
>
>*"${sys:user.home}/logs/webapp.log"*
>
>  filePattern=
> *"${sys:user.home}/logs/webapp-%d{-MM-dd}-%i.log"*
>
>  bufferedIO=*"false"* advertiseURI=
> *"file:///C://users/bilguuna/logs/webapp.log"*
>
>  advertise=*"true"*>
>
>  
>
>  
>
>
>
>
>
>  
>
>  
>
>   
>
>
>
>
>
>   
>
>  
>
>  
>
>  
>
>   
>
>
>
> 
>
>
> On the ZeroConf tab, I see 2 receivers which are configuration and LogFile
> that both are connected. When I double click any of them, it just changes
> Connection status but not showing any logs. What should I do?
>
>
> Update: I realized that in zeroconf folder of the chainsaw-log tab, it said
> Remote host [10.20.91.20] refused connection. Is that might be the reason?
>
>
> Thank you
>

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



Re: How to get Log4j2, Tomcat and Chainsaw work together?

2014-07-23 Thread Scott Deboy
Regarding Chainsaw, it currently doesn't support the XML format
generated by Log4j2, but does support pattern layout based log
formats.  Chainsaw supports most regular text log formats, and has
special support for Log4j's pattern layout.

I'd suggest either configuring Chainsaw manually, or use the
advertiser mechanism described here:
http://logging.apache.org/log4j/2.x/manual/configuration.html#ChainsawSupport

The log4j2 advertiser mechanism works with patternlayout-formatted log
files and requires  the jmdns jar to be on the classpath.

To configure Chainsaw manually to tail a log file generated with a
pattern layout, choose the 'process a log file' option from Chainsaw's
'load Chainsaw configuration' menu option.  If the log file is on the
local file system, browse to it via the 'open file' button.

Next, set the 'log file format type' to PaternLayout format and
provide the pattern layout format used by your appender, then specify
the timestamp format used in your pattern layout.

You can save this configuration in this dialog as an xml file for
later use, and you can tell Chainsaw to always use this configuration
when starting.

Hope that helps.  Feel free to send questions to the list.

Scott


On 7/23/14, Ralph Goers ralph.go...@dslextreme.com wrote:
 I recall that there are dependencies on both the jackson 2.x and 1.x jars.

 Ralph

 On Jul 23, 2014, at 8:36 AM, Kari Arvonen suomila...@gmail.com wrote:

 Hello,

 Versions:
 - Apache Log4j2 2.0 release version
 - Apache Tomcat 7.0.54
 - Apache Chainsaw 2.1 snapshot (http://people.apache.org/~sdeboy/)
 - Oracle Java SE 7 u60 JDK

 I have tried to get the XMLLayout to work with Log4j2 assuming it is the
 best format for Chainsaw. What is preferred way to do this?

 In any case current log4j2.xml placed in one of the Webapps
 WEB-INF\classes
 -directory
 ?xml version=1.0 encoding=UTF-8?
 Configuration status=ALL
  Appenders
File name=XmlFile fileName=logs/Atest.log
 immediateFlush=true append=true
  XMLLayout complete=true charset=UTF-8 compact=false/
/File
  /Appenders

  Loggers
AsyncRoot level=ALL includeLocation=false
  AppenderRef ref=XmlFile/
/AsyncRoot
  /Loggers
 /Configuration

 Configuration is read properly. Where I have been struggling is which
 jars
 and which versions to include. I have tried various versions and seem to
 have always either class not found or implementation missing.

 Jars and versions:
 - log4j-api-2.0.jar, log4j-core-2.0.jar, log4j-web-2.0.jar,
 log4j-1.2-api-2.0.jar
 - disruptor-3.2.1.jar
 - jackson-annotations-2.4.1.jar, jackson-core-2.4.1.1.jar,
 jackson-databind-2.4.1.2.jar
 - jackson-dataformat-xml-2.4.1.jar, jackson-datatype-jdk7-2.4.1.jar,
 jackson-datatype-json-org-2.4.1.jar,
 jackson-module-jaxb-annotations-2.4.1.jar
 - stax2-api-3.1.4.jar

 I have tried with less jars and various version combinations without
 success. Best I have had is log gets written, but only actual text to be
 logged not with full XML events. Non XML-layout worked fine.

 Code snippets in webapp servlet:
 // Log4J 2.x
 import org.apache.logging.log4j.LogManager;
 import org.apache.logging.log4j.Logger;
 import org.apache.logging.log4j.EventLogger;

 private Logger log = null;

 this.log = LogManager.getLogger(EventReceiverServlet.class.getName());

 log.info(Logger initiated);
 log.debug(åäöÅÄÖ);
 log.debug(Добро пожаловать.);

 Latest exception:
 SEVERE: Exception processing: 0
 org.apache.logging.log4j.core.async.AsyncLoggerConfigHelper$Log4jEventWrapper@1045e84
 java.lang.NoSuchMethodError:
 com.fasterxml.jackson.databind.util.LRUMap.put(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;
 at
 com.fasterxml.jackson.dataformat.xml.util.XmlRootNameLookup.findRootName(XmlRootNameLookup.java:83)

 Any help would  be appreciated.

 Regards, Suomilapsi


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



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



Re: maven build for source does not work

2014-04-28 Thread Scott Deboy
It is not true that we don't maintain 1.2 any longer. If important issues
are found we may still address them even though we are focused on Log4j2.
On Apr 28, 2014 4:01 PM, Matt Sicker boa...@gmail.com wrote:

 We don't maintain 1.2.x anymore. Also, I think you're supposed to use ant
 to build 1.2.

 Please check out Log4j 2.0, though, as we're preparing to release that and
 would like feedback.


 On 28 April 2014 14:30, walter_mar...@dellteam.com wrote:

  Dell - Internal Use - Confidential
 
 
  1)  The pom file has to be updated to allow for maven-site-plugin 3.3
  rather than 3.1
 
  2)  The mvm staging step gives a null pointer exception
 
  Apache.log4j-1.2.17
 
  Thanks
 
  Walter
 



 --
 Matt Sicker boa...@gmail.com



Re: [ANNOUNCEMENT] Welcome Matt Sicker

2014-03-03 Thread Scott Deboy
Welcome!

Scott
 On Mar 3, 2014 2:09 PM, Remko Popma remko.po...@gmail.com wrote:

 Here you are:

 To subscribe to the list, send a message to:
   commits-subscr...@logging.apache.org

 Remko


 On Tuesday, March 4, 2014, Matt Sicker boa...@gmail.com wrote:

  So is there a commits mailing list or something I should know about?
 
 
  On 3 March 2014 08:22, Nick Williams nicho...@nicholaswilliams.net
 javascript:;
  wrote:
 
   Congratulations, Matt! Welcome aboard!
  
   Nick
  
   On Mar 3, 2014, at 8:20 AM, Remko Popma wrote:
  
Welcome Matt!
   
   
On Mon, Mar 3, 2014 at 10:57 PM, Matt Sicker boa...@gmail.com
 javascript:;
  wrote:
   
Thanks guys! I'm looking forward to making more direct contributions
   now!
In fact, cleaning up some unit tests was something that's been
 itching
   me
for a while :)
   
Matt Sicker
   
On Mar 3, 2014, at 7:51, Gary Gregory garydgreg...@gmail.com
 javascript:;
  wrote:
   
Welcome aboard Matt. I'm looking forward to collaborating with you!
   
Gary
   
   
On Mon, Mar 3, 2014 at 8:39 AM, Ralph Goers rgo...@apache.org
 javascript:;
  
   wrote:
   
Welcome Matt!
   
Ralph
   
On Mar 2, 2014, at 11:43 PM, Dominik Psenner 
 dpsen...@apache.orgjavascript:;
  
wrote:
   
Hi,
   
   
   
it is my pleasure to announce to the community
   
that Matt Sicker has joined our ranks.
   
   
   
He made remarkable contributions to LOG4J
   
and we all believe he is a valuable member
   
of Apache Logging Services now and in future.
   
   
   
Kind regards,
   
Dominik Psenner
   
   
--
E-Mail: garydgreg...@gmail.com javascript:; |
 ggreg...@apache.orgjavascript:;
Java Persistence with Hibernate, Second Edition
http://www.manning.com/bauer3/
JUnit in Action, Second Edition http://www.manning.com/tahchiev/
Spring Batch in Action http://www.manning.com/templier/
Blog: http://garygregory.wordpress.com
Home: http://garygregory.com/
Tweet! http://twitter.com/GaryGregory
   
   
 -
To unsubscribe, e-mail: log4j-user-unsubscr...@logging.apache.org
 javascript:;
For additional commands, e-mail: log4j-user-h...@logging.apache.org
 javascript:;
   
   
  
  
 
 
  --
  Matt Sicker boa...@gmail.com javascript:;
 



Re: Log4j2 - JConsole JMX appender

2013-10-30 Thread Scott Deboy
Mi Mahesh,

If you'd like to use Chainsaw with log4j2, you need to use the latest
Chainsaw developer snapshot, available here:
http://people.apache.org/~sdeboy

If you use a file appender in your log4j configuration, add the JmDns
jar to your application classpath (http://jmdns.sourceforge.net), and
update your log4j configuration as described in the documentation
(including specifying a URI to your log file), Chainsaw should be able
to parse and tail your log file.

Feel free to ask additional questions here on the user list.

Scott

On 10/28/13, Mahesh Dilhan mail.mahesh...@gmail.com wrote:
 Thanks for the clarification Remko


 On Tue, Oct 29, 2013 at 8:52 AM, Remko Popma remko.po...@gmail.com wrote:

 Hi Mahesh,

 Thank you for re-posting your question to the user mailing list.

 The Status Logger is a special logger used by log4j internally.
 If you set it to debug or trace (by starting your config xml file
 with Configuration
 status=debug...),
 it will output things like which appenders and loggers were initialized,
 which log4j plugins were found, etc.
 Any configuration problems will show up in the status log.
 The status log output will appear on the console (System.out).

 In JConsole, this internal logging is what you see in the StatusLogger
 tab.

 I'm guessing from your question that you would like to see the log
 statements produced by your application in the JConsole viewer.
 Unfortunately, JMX currently does not provide a way to show the content
 of
 application log files.

 If you are looking for a tool that allows you to view the log file from a
 remote machine you may want to take a look at Chainsaw.
 http://logging.apache.org/chainsaw/

 Scott Deboy has been doing work to make Chainsaw's zeroconf feature work
 well with log4j2.
 I am not that familiar with Chainsaw, but perhaps this documentation can
 get you started:

 http://logging.apache.org/log4j/2.x/manual/configuration.html#AdvertisingAppenderConfigurations

 Best regards,
 Remko



 On Tue, Oct 29, 2013 at 9:58 AM, Mahesh Dilhan mail.mahesh...@gmail.com
 wrote:

  Hi All,
 
  i'm interested in learning on JMX monitoring in log4j2.
 
  As explained I was able to get the log4j2 'tab'  statusLogger child
  tab
 in
  JConsole with the initial logging statements.
 
  Note:version : 2.0.9beta
 
  log4j2.xml
 
  ?xml version=1.0 encoding=UTF-8?
 
  !-- No need to set system property Log4jContextSelector to any value
   when using asyncLogger or asyncRoot. --
 
  Configuration status=debug
Appenders
  !-- Async Loggers will auto-flush in batches, so switch off
  immediateFlush. --
  RandomAccessFile name=RandomAccessFile
  fileName=asyncWithLocation.log
immediateFlush=false append=false
PatternLayout
  Pattern%d %p %class{1.} [%t] %location %m %ex%n/Pattern
/PatternLayout
  /RandomAccessFile
 
/Appenders
Loggers 
  !-- pattern layout actually uses location, so we need to include
  it
  --
  AsyncLogger  name=notificationLogger level=trace
  includeLocation=true
AppenderRef ref=RandomAccessFile/
  /AsyncLogger
  Root level=debug includeLocation=true
AppenderRef ref=notificationLogger/
  /Root
/Loggers
  /Configuration
 
  !-- notificationLogger --
  private static Logger logger =
 LogManager.getLogger(notificationLogger);
 
 
  When web Application(java/servlet/spring) runs I can see the
  file[asyncWithLocation.log] get appended with the logging statements,
  I like to see Jconsole get appended too, But It did not.
 
 
  I wonder, what configuration I should use to enable jmx logging, so
  that
 I
  can see them in JConsole?
 
  is there any documentation other than this
  http://logging.apache.org/log4j/2.x/manual/jmx.html,
 
  it would be great if above documentation is updated with a sample of
  log4j2.xml configuration.
 
  Thanks
 
  Mahesh
 




 Mahesh


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



Re: Log4j2 - JConsole JMX appender

2013-10-30 Thread Scott Deboy
The page makes it clear that async loggers provide a clear
throughput/latency advantage over async appenders...but.

If folks use both async appenders and async loggers, won't that
actually increase latency over just using async loggers?  Then use all
of that with random access file appenders..and folks are actually
shooting themselves in the foot.

That's mostly what I'm talking about.

Makes me wonder if we really need two mechanisms - can we get by with
one? or is the problem that you have to define at the logger level,
which is a pain?

Scott

On 10/30/13, Remko Popma remko.po...@gmail.com wrote:
 Async loggers use the LMAX disruptor to remove lock contention when many
 threads are logging simultaneously. This is faster than the queue used by
 AsyncAppender.
 This is all documented I think, but let me know what part of the current
 docs should be fixed.

 By default the disruptor ringbuffer is configured to be very large  will
 consume about 30 MB of memory. This bit can be documented better.

 I didn't think it mattered whether the underlying appender does file IO or
 network IO. Did I miss something?

 Remko

 On Thursday, October 31, 2013, Scott Deboy wrote:

 I'm not clear myself on when an async logger is useful - I am more
 familiar with the (previously existing) concept of async appenders.

 I think the documentation in this area needs to be enhanced to explain
 why you would use async loggers or async appenders, particularly for
 file IO.

 As for generating log files with dates, yes, you can specify your own
 date-related pattern with a RollingFileAppender.  See the
 documentation on RollingFileAppender and examples here:
 http://logging.apache.org/log4j/2.x/manual/appenders.html

 Scott

 On 10/30/13, Mahesh Dilhan mail.mahesh...@gmail.com wrote:
  Hi Scott
 
  I already configured it , yes it works for fileAppeders.
  I have seen the perftest of async logger. will there be performance hit
  with fileAppender compared to async logger? I already noticed time
  taken
  for initialization process is varying for file and random access file.
  is
  it because of distruptor?
 
  is there a way to output log file name as :
  *web-application-context-path*-date.log
  ? [configuration of log4j2,xml]
 
  Thanks
 
 
 
 
  On Thu, Oct 31, 2013 at 3:16 AM, Scott Deboy scott.de...@gmail.com
 wrote:
 
  Mi Mahesh,
 
  If you'd like to use Chainsaw with log4j2, you need to use the latest
  Chainsaw developer snapshot, available here:
  http://people.apache.org/~sdeboy
 
  If you use a file appender in your log4j configuration, add the JmDns
  jar to your application classpath (http://jmdns.sourceforge.net), and
  update your log4j configuration as described in the documentation
  (including specifying a URI to your log file), Chainsaw should be able
  to parse and tail your log file.
 
  Feel free to ask additional questions here on the user list.
 
  Scott
 
  On 10/28/13, Mahesh Dilhan mail.mahesh...@gmail.com wrote:
   Thanks for the clarification Remko
  
  
   On Tue, Oct 29, 2013 at 8:52 AM, Remko Popma remko.po...@gmail.com
  wrote:
  
   Hi Mahesh,
  
   Thank you for re-posting your question to the user mailing list.
  
   The Status Logger is a special logger used by log4j internally.
   If you set it to debug or trace (by starting your config xml
   file
   with Configuration
   status=debug...),
   it will output things like which appenders and loggers were
   initialized,
   which log4j plugins were found, etc.
   Any configuration problems will show up in the status log.
   The status log output will appear on the console (System.out).
  
   In JConsole, this internal logging is what you see in the
 StatusLogger
   tab.
  
   I'm guessing from your question that you would like to see the log
   statements produced by your application in the JConsole viewer.
   Unfortunately, JMX currently does not provide a way to show the
   content
   of
   application log files.
  
   If you are looking for a tool that allows you to view the log file
   from
  a
   remote machine you may want to take a look at Chainsaw.
   http://logging.apache.org/chainsaw/
  
   Scott Deboy has been doing work to make Chainsaw's zeroconf feature
   work
   well with log4j2.
   I am not that familiar with Chainsaw, but perhaps this
   documentation
   can
   get you started:
  
  
 
 http://logging.apache.org/log4j/2.x/manual/configuration.html#AdvertisingAppenderConfigurations
  
   Best regards,
   Remko
  
  
  
   On Tue, Oct 29, 2013 at 9:58 AM, Mahesh Dilhan 
 


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



Re: Log4j2 - JConsole JMX appender

2013-10-30 Thread Scott Deboy
What might be easiest is to use separate log4j configurations for each
web app, specifying unique names in each web app's log4j configuration
file.  See http://logging.apache.org/log4j/2.x/manual/logsep.html for
more information.

http://logging.apache.org/log4j/2.x/manual/webapp.html mentions that
the ServletContext's context name is used as the LoggerContext name,
but the LoggerContext name isn't exposed anywhere that I can see as
something you could use in the naming of your rolling file.

You may be able to do this by implementing your own Lookup - see
http://logging.apache.org/log4j/2.x/manual/extending.html

Hope that helps.

Scott

On 10/30/13, Mahesh Dilhan mail.mahesh...@gmail.com wrote:
 Hi Scott

 thanks for the reply.

 Actually I wanted to know that how to get the *web-application-context-path
 dynamically, without hard-code in the log4j2.xml.*
 *
 *
 *Sorry for the inconvenience, if i did not make my self clear .*
 *
 *
  is there a way to output log file name as :
 *web-application-context-path
 *-date.log ? [configuration of log4j2,xml]

 Yes I did append the *date* by looking at RollingAppender.

 Thanks



 On Thu, Oct 31, 2013 at 6:48 AM, Scott Deboy scott.de...@gmail.com wrote:

 I'm not clear myself on when an async logger is useful - I am more
 familiar with the (previously existing) concept of async appenders.

 I think the documentation in this area needs to be enhanced to explain
 why you would use async loggers or async appenders, particularly for
 file IO.

 As for generating log files with dates, yes, you can specify your own
 date-related pattern with a RollingFileAppender.  See the
 documentation on RollingFileAppender and examples here:
 http://logging.apache.org/log4j/2.x/manual/appenders.html

 Scott

 On 10/30/13, Mahesh Dilhan mail.mahesh...@gmail.com wrote:
  Hi Scott
 
  I already configured it , yes it works for fileAppeders.
  I have seen the perftest of async logger. will there be performance hit
  with fileAppender compared to async logger? I already noticed time
  taken
  for initialization process is varying for file and random access file.
  is
  it because of distruptor?
 
  is there a way to output log file name as :
  *web-application-context-path*-date.log
  ? [configuration of log4j2,xml]
 
  Thanks
 
 
 
 
  On Thu, Oct 31, 2013 at 3:16 AM, Scott Deboy scott.de...@gmail.com
 wrote:
 
  Mi Mahesh,
 
  If you'd like to use Chainsaw with log4j2, you need to use the latest
  Chainsaw developer snapshot, available here:
  http://people.apache.org/~sdeboy
 
  If you use a file appender in your log4j configuration, add the JmDns
  jar to your application classpath (http://jmdns.sourceforge.net), and
  update your log4j configuration as described in the documentation
  (including specifying a URI to your log file), Chainsaw should be able
  to parse and tail your log file.
 
  Feel free to ask additional questions here on the user list.
 
  Scott
 
  On 10/28/13, Mahesh Dilhan mail.mahesh...@gmail.com wrote:
   Thanks for the clarification Remko
  
  
   On Tue, Oct 29, 2013 at 8:52 AM, Remko Popma remko.po...@gmail.com
  wrote:
  
   Hi Mahesh,
  
   Thank you for re-posting your question to the user mailing list.
  
   The Status Logger is a special logger used by log4j internally.
   If you set it to debug or trace (by starting your config xml
   file
   with Configuration
   status=debug...),
   it will output things like which appenders and loggers were
   initialized,
   which log4j plugins were found, etc.
   Any configuration problems will show up in the status log.
   The status log output will appear on the console (System.out).
  
   In JConsole, this internal logging is what you see in the
 StatusLogger
   tab.
  
   I'm guessing from your question that you would like to see the log
   statements produced by your application in the JConsole viewer.
   Unfortunately, JMX currently does not provide a way to show the
   content
   of
   application log files.
  
   If you are looking for a tool that allows you to view the log file
   from
  a
   remote machine you may want to take a look at Chainsaw.
   http://logging.apache.org/chainsaw/
  
   Scott Deboy has been doing work to make Chainsaw's zeroconf feature
   work
   well with log4j2.
   I am not that familiar with Chainsaw, but perhaps this
   documentation
   can
   get you started:
  
  
 
 http://logging.apache.org/log4j/2.x/manual/configuration.html#AdvertisingAppenderConfigurations
  
   Best regards,
   Remko
  
  
  
   On Tue, Oct 29, 2013 at 9:58 AM, Mahesh Dilhan 
  mail.mahesh...@gmail.com
   wrote:
  
Hi All,
   
i'm interested in learning on JMX monitoring in log4j2.
   
As explained I was able to get the log4j2 'tab'  statusLogger
 child
tab
   in
JConsole with the initial logging statements.
   
Note:version : 2.0.9beta
   
log4j2.xml
   
?xml version=1.0 encoding=UTF-8?
   
!-- No need to set system property Log4jContextSelector to any
  value

Re: Log4j2 - JConsole JMX appender

2013-10-30 Thread Scott Deboy
Actually there is already a WebLookup, which supports 'contextPath',
'servletContextName', etc.  See:
http://logging.apache.org/log4j/2.x/manual/lookups.html

On 10/30/13, Scott Deboy scott.de...@gmail.com wrote:
 What might be easiest is to use separate log4j configurations for each
 web app, specifying unique names in each web app's log4j configuration
 file.  See http://logging.apache.org/log4j/2.x/manual/logsep.html for
 more information.

 http://logging.apache.org/log4j/2.x/manual/webapp.html mentions that
 the ServletContext's context name is used as the LoggerContext name,
 but the LoggerContext name isn't exposed anywhere that I can see as
 something you could use in the naming of your rolling file.

 You may be able to do this by implementing your own Lookup - see
 http://logging.apache.org/log4j/2.x/manual/extending.html

 Hope that helps.

 Scott

 On 10/30/13, Mahesh Dilhan mail.mahesh...@gmail.com wrote:
 Hi Scott

 thanks for the reply.

 Actually I wanted to know that how to get the
 *web-application-context-path
 dynamically, without hard-code in the log4j2.xml.*
 *
 *
 *Sorry for the inconvenience, if i did not make my self clear .*
 *
 *
  is there a way to output log file name as :
 *web-application-context-path
 *-date.log ? [configuration of log4j2,xml]

 Yes I did append the *date* by looking at RollingAppender.

 Thanks



 On Thu, Oct 31, 2013 at 6:48 AM, Scott Deboy scott.de...@gmail.com
 wrote:

 I'm not clear myself on when an async logger is useful - I am more
 familiar with the (previously existing) concept of async appenders.

 I think the documentation in this area needs to be enhanced to explain
 why you would use async loggers or async appenders, particularly for
 file IO.

 As for generating log files with dates, yes, you can specify your own
 date-related pattern with a RollingFileAppender.  See the
 documentation on RollingFileAppender and examples here:
 http://logging.apache.org/log4j/2.x/manual/appenders.html

 Scott

 On 10/30/13, Mahesh Dilhan mail.mahesh...@gmail.com wrote:
  Hi Scott
 
  I already configured it , yes it works for fileAppeders.
  I have seen the perftest of async logger. will there be performance
  hit
  with fileAppender compared to async logger? I already noticed time
  taken
  for initialization process is varying for file and random access file.
  is
  it because of distruptor?
 
  is there a way to output log file name as :
  *web-application-context-path*-date.log
  ? [configuration of log4j2,xml]
 
  Thanks
 
 
 
 
  On Thu, Oct 31, 2013 at 3:16 AM, Scott Deboy scott.de...@gmail.com
 wrote:
 
  Mi Mahesh,
 
  If you'd like to use Chainsaw with log4j2, you need to use the latest
  Chainsaw developer snapshot, available here:
  http://people.apache.org/~sdeboy
 
  If you use a file appender in your log4j configuration, add the JmDns
  jar to your application classpath (http://jmdns.sourceforge.net), and
  update your log4j configuration as described in the documentation
  (including specifying a URI to your log file), Chainsaw should be
  able
  to parse and tail your log file.
 
  Feel free to ask additional questions here on the user list.
 
  Scott
 
  On 10/28/13, Mahesh Dilhan mail.mahesh...@gmail.com wrote:
   Thanks for the clarification Remko
  
  
   On Tue, Oct 29, 2013 at 8:52 AM, Remko Popma
   remko.po...@gmail.com
  wrote:
  
   Hi Mahesh,
  
   Thank you for re-posting your question to the user mailing list.
  
   The Status Logger is a special logger used by log4j internally.
   If you set it to debug or trace (by starting your config xml
   file
   with Configuration
   status=debug...),
   it will output things like which appenders and loggers were
   initialized,
   which log4j plugins were found, etc.
   Any configuration problems will show up in the status log.
   The status log output will appear on the console (System.out).
  
   In JConsole, this internal logging is what you see in the
 StatusLogger
   tab.
  
   I'm guessing from your question that you would like to see the log
   statements produced by your application in the JConsole viewer.
   Unfortunately, JMX currently does not provide a way to show the
   content
   of
   application log files.
  
   If you are looking for a tool that allows you to view the log file
   from
  a
   remote machine you may want to take a look at Chainsaw.
   http://logging.apache.org/chainsaw/
  
   Scott Deboy has been doing work to make Chainsaw's zeroconf
   feature
   work
   well with log4j2.
   I am not that familiar with Chainsaw, but perhaps this
   documentation
   can
   get you started:
  
  
 
 http://logging.apache.org/log4j/2.x/manual/configuration.html#AdvertisingAppenderConfigurations
  
   Best regards,
   Remko
  
  
  
   On Tue, Oct 29, 2013 at 9:58 AM, Mahesh Dilhan 
  mail.mahesh...@gmail.com
   wrote:
  
Hi All,
   
i'm interested in learning on JMX monitoring in log4j2.
   
As explained I was able to get the log4j2 'tab'  statusLogger
 child

Re: [ANNOUNCEMENT] Apache Log4j Extras 1.2.17 released

2013-10-20 Thread Scott Deboy
Yes, it looks like something went a bit sideways with the -bin jar.
The source jar is correct (no Appender class), but the -bin jar does
have the additional classes in it.

Scott

On 10/20/13, Jess Holle je...@ptc.com wrote:
 So I just downloaded apache-log4j-extras-1.2.17-bin.zip, pulled out
 apache-log4j-extras-1.2.17.jar, and took a peek.

 Straight away, I notice org/apache/log4j/Appender.class -- and other
 duplicate classes.

 I will admit I should have examined the release candidate, but I didn't
 think the double-check this -- as the issue seems clear enough.  Yet the
 classes seem to be duplicated once again.

 On 10/20/2013 3:24 AM, Christian Grobmeier wrote:
 The Apache Log4j 1 team is pleased to announce the release of Apache
 Log4j Extras 1.2.17.

 Apache Extras™ for Apache log4j™ is a jar file full of additional
 functionality for log4j 1.2.x.

 This release is a maintenance release.

 Changes:

 - Version naming changed to match the required log4j version.
 - RollingFileAppender with TimeBasedRolling policy doesn't create
 parent-path if FileNamePattern contains date pattern as directory
 (thanks to Daniel Stankiewicz) Fixes 53536.
 - DBAppender has a compile error (thanks to Antonio Petrelli) Fixes
 53645.
 - Prefixed FormattingInfo and PatternParser with Extras to avoid
 classloading conflict
 - Fixed product naming
 - Removed duplicated classes (thanks to Jess Holle for spotting it)
 - Removed ant build
 - Made tests writing to target folder
 - Merged all companions into the extras companion
 - Switched Parent to Apache parent Fixes 47595.
 - Upgraded to Apache Maven 3

 Apache Log4j Extras 1.2.17 required Java  1.4.2 and Log4j 1.2.17.

 For more information please visit the product website:

 http://logging.apache.org/log4j/extras

 -
 To unsubscribe, e-mail: log4j-dev-unsubscr...@logging.apache.org
 For additional commands, e-mail: log4j-dev-h...@logging.apache.org




 -
 To unsubscribe, e-mail: log4j-dev-unsubscr...@logging.apache.org
 For additional commands, e-mail: log4j-dev-h...@logging.apache.org



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



Re: Chainsaw and Log4j2

2013-10-17 Thread Scott Deboy
Chainsaw has been updated and offered via developer snapshots, but
those updates haven't been released.  The latest developer snapshot is
available at http://people.apache.org/~sdeboy

We are working on an updated release of log4j extras, which Chainsaw
needs.  Once extras is released, we'll release an updated version of
Chainsaw as soon as possible.

As for log4j2 support, the latest developer snapshot of Chainsaw was
recently updated to leverage the 'advertiser' capability built into
Log4j2.

The advertiser mechanism enables log4j2 to advertise fileappender
configurations via multicast DNS/zeroconf.  Chainsaw can discover
these advertised configurations, and you can start tailing the log
file without having to configure Chainsaw at all, just by
double-clicking on the discovered appender entry in Chainsaw's
'Zeroconf' tab.

For more information on how to enable the advertiser mechanism in
log4j2, see 
http://logging.apache.org/log4j/2.x/manual/configuration.html#AdvertisingAppenderConfigurations

To use the multicast DNS advertiser, you need to add the jmdns
(http://jmdns.sourceforge.net) jar to your appender-side classpath and
specify a few parameters in your appender configuration.  Once your
log file has started generating entries in the log file, you can start
Chainsaw and double-click on the entry that shows up in the Zeroconf
tab in order to remotely tail the log file.

From there, you can save off that Chainsaw 'receiver' configuration,
so you can tail the log file from Chainsaw even when the advertiser
mechanism isn't advertising the appender details.

Feel free to send additional questions to the list.

Scott


On 10/17/13, Peter DePasquale peter.depasqu...@gmail.com wrote:
 Can anyone clarify the status of chainsaw w.r.t Log4j2?  It seems that
 chainsaw is pretty old and no longer being developed. Does it work
 with log4j2? Thanks.

 --
 Peter J. DePasquale, Ph.D.
 Department of Computer Science
 The College of New Jersey
 (e) depasqua [at] tcnj [dot] edu
 (p) 609-771-2806
 (f) 609-637-5190
 (o) Holman Hall - Room 238
 (l) Holman Hall - Room 255

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



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



Re: Log4j2: Column casting in JDBCAppender

2013-08-22 Thread Scott Deboy
You mean like:
http://logging.apache.org/log4j/companions/receivers/apidocs/org/apache/log4j/db/dialect/package-summary.html

Scott

On 8/22/13, Nick Williams nicho...@nicholaswilliams.net wrote:
 IMO, this is a bug in the PGSQL JDBC driver and not something that Log4j can
 easily (or should) address. For a detailed discussion, see the PGSQL thread
 about casting text to PGSQL enums [1].

 The problem lies in PGSQL's type handling. With PGSQL, MySQL, and any other
 database type that supports enums, you can write a query like this:

 INSERT INTO myTable (enumColumn) VALUES ('enumValue');

 And the database engine implicitly casts the text to enum. If you try this
 out on a PGSQL prompt, it works. However, unlike MySQL and other vendors,
 PGSQL does NOT allow String parameters in prepared statements to be
 auto-casted to enums. So the following is valid in all vendors that support
 enums:

 statement = connection.prepareStatement(INSERT INTO myTable (enumColumn)
 VALUES ('enumValue'));

 But the following, while valid with MySQL and everything else, breaks with
 PGSQL's JDBC driver:

 statement = connection.prepareStatement(INSERT INTO myTable (enumColumn)
 VALUES (?));
 statement.setString(1, enumValue);

 IMO, this was a stupid decision on PGSQL's part, and from the thread it
 sounds like others agree with me. It makes it extremely difficult to use
 PGSQL enums with, for example, the Java Persistence API or O/RMs in general.
 From the sounds of the thread, the guys over at PGSQL have to intention of
 fixing this.

 Now, as for your suggestion. As much as I'd like to accommodate your need
 here, it's simply not feasible. Nearly every single database vendor has a
 different way to cast data types. Some have a CAST function, others a CAST
 keyword, and then PGSQL has that odd double-colon syntax (::). If we were to
 add a casting feature, we would then have to have a sense of database
 dialects like an O/RM and learn the syntax of each database, correctly
 applying the syntax based on what type of database we're logging to. This
 would be a heavyweight bulky addition to such a simple feature. My
 recommendations, in descending order of how much effort it will require:

 1) Submit a patch to PGSQL's JDBC driver and lobby for its acceptance.
 2) Switch to a database vendor that's less [insert insulting word here]
 about its enum casting--like any of the other ones. My favorite is MySQL.
 3) Stop using a database enum column.

 :-/

 Nick

 [1]
 http://www.postgresql.org/message-id/cappfruyta0a0xghg4zh785ss0_fz8gczzcjzgxo2yfphadx...@mail.gmail.com

 On Aug 22, 2013, at 4:12 PM, Peter Rifel wrote:

 Hello,

 I'm wondering if it is at all possible to cast columns to a certain type
 (a custom enum) with the JDBCAppender.  I have an existing PostgreSQL
 database that I send all warnings and errors to and the log level is
 currently being stored as an enum.  When I try and log to the database I
 get the following message:

 org.postgresql.util.PSQLException: ERROR: column level is of type
 log_level but expression is of type character varying  Hint: You will need
 to rewrite or cast the expression.

 Looking through the JDBCDatabaseManager it doesn't appear that this is
 possible; including the cast in the pattern string results in it getting
 passed as the value itself rather than the prepared statement.  Does
 anyone have any other ideas on how to accomplish this?  I wouldn't mind
 making contributions to the source code to help implement this feature if
 it is desired.

 Thanks,

 Peter



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



Re: Log4j2: Column casting in JDBCAppender

2013-08-22 Thread Scott Deboy
That doesn't look like much work.  Particularly since you could lift
what's provided and just extend it to support the one-off we're
talking about here, yes?

On 8/22/13, Nick Williams nicho...@nicholaswilliams.net wrote:
 Yes, I mean like that. I want to avoid something like that.

 N

 On Aug 22, 2013, at 4:59 PM, Scott Deboy wrote:

 You mean like:
 http://logging.apache.org/log4j/companions/receivers/apidocs/org/apache/log4j/db/dialect/package-summary.html

 Scott

 On 8/22/13, Nick Williams nicho...@nicholaswilliams.net wrote:
 IMO, this is a bug in the PGSQL JDBC driver and not something that Log4j
 can
 easily (or should) address. For a detailed discussion, see the PGSQL
 thread
 about casting text to PGSQL enums [1].

 The problem lies in PGSQL's type handling. With PGSQL, MySQL, and any
 other
 database type that supports enums, you can write a query like this:

 INSERT INTO myTable (enumColumn) VALUES ('enumValue');

 And the database engine implicitly casts the text to enum. If you try
 this
 out on a PGSQL prompt, it works. However, unlike MySQL and other
 vendors,
 PGSQL does NOT allow String parameters in prepared statements to be
 auto-casted to enums. So the following is valid in all vendors that
 support
 enums:

 statement = connection.prepareStatement(INSERT INTO myTable
 (enumColumn)
 VALUES ('enumValue'));

 But the following, while valid with MySQL and everything else, breaks
 with
 PGSQL's JDBC driver:

 statement = connection.prepareStatement(INSERT INTO myTable
 (enumColumn)
 VALUES (?));
 statement.setString(1, enumValue);

 IMO, this was a stupid decision on PGSQL's part, and from the thread it
 sounds like others agree with me. It makes it extremely difficult to use
 PGSQL enums with, for example, the Java Persistence API or O/RMs in
 general.
 From the sounds of the thread, the guys over at PGSQL have to intention
 of
 fixing this.

 Now, as for your suggestion. As much as I'd like to accommodate your
 need
 here, it's simply not feasible. Nearly every single database vendor has
 a
 different way to cast data types. Some have a CAST function, others a
 CAST
 keyword, and then PGSQL has that odd double-colon syntax (::). If we were
 to
 add a casting feature, we would then have to have a sense of database
 dialects like an O/RM and learn the syntax of each database, correctly
 applying the syntax based on what type of database we're logging to.
 This
 would be a heavyweight bulky addition to such a simple feature. My
 recommendations, in descending order of how much effort it will require:

 1) Submit a patch to PGSQL's JDBC driver and lobby for its acceptance.
 2) Switch to a database vendor that's less [insert insulting word here]
 about its enum casting--like any of the other ones. My favorite is
 MySQL.
 3) Stop using a database enum column.

 :-/

 Nick

 [1]
 http://www.postgresql.org/message-id/cappfruyta0a0xghg4zh785ss0_fz8gczzcjzgxo2yfphadx...@mail.gmail.com

 On Aug 22, 2013, at 4:12 PM, Peter Rifel wrote:

 Hello,

 I'm wondering if it is at all possible to cast columns to a certain
 type
 (a custom enum) with the JDBCAppender.  I have an existing PostgreSQL
 database that I send all warnings and errors to and the log level is
 currently being stored as an enum.  When I try and log to the database
 I
 get the following message:

 org.postgresql.util.PSQLException: ERROR: column level is of type
 log_level but expression is of type character varying  Hint: You will
 need
 to rewrite or cast the expression.

 Looking through the JDBCDatabaseManager it doesn't appear that this is
 possible; including the cast in the pattern string results in it
 getting
 passed as the value itself rather than the prepared statement.  Does
 anyone have any other ideas on how to accomplish this?  I wouldn't mind
 making contributions to the source code to help implement this feature
 if
 it is desired.

 Thanks,

 Peter



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



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



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



Re: Programmatically setting log4j2 log level

2013-05-18 Thread Scott Deboy
From looking at this, seems like config.getRootLoggerConfig() would be a
better name.
On May 17, 2013 10:40 PM, Ralph Goers ralph.go...@dslextreme.com wrote:

 No, the X Logger does not inherit its level from the root Logger. It
 inherits its level from the root LoggerConfig.  See the picture at
 http://logging.apache.org/log4j/2.x/manual/architecture.html.

 The level you are modifying is brought into each Logger so that the level
 can be tested very quickly.  That is why the note on the setLevel method
 says it is there primarily for unit testing.

 To do what you are attempting below you would need to do:

 LoggerContext ctx = (LoggerContext) LogManager.getContext(false);
 Configuration config = ctx.getConfiguration();
 LoggerConfig loggerConfig = config.getRootLogger();
 /* You could also specify the actual logger name as below and it will
 return the LoggerConfig used by the Logger.
 LoggerConfig loggerConfig = getLoggerConfig(X);
 */
 loggerConfig.setLevel(Level.DEBUG);
 ctx.updateLoggers();  // This causes all Loggers to refetch information
 from their LoggerConfig.

 Ralph


 On May 17, 2013, at 11:56 AM, Eric Scheie wrote:

  Here is a simple program that can reproduce my problem:
 
 
  import org.apache.logging.log4j.Level;
  import org.apache.logging.log4j.LogManager;
  import org.apache.logging.log4j.Logger;
 
 
  public class Main
  {
 public static void main(String[] args)
 {
 Logger rootLogger =
  LogManager.getLogger(LogManager.ROOT_LOGGER_NAME);
 Logger xLogger = LogManager.getLogger(X);
 
 xLogger.info(This is an INFO log message.);
 
 
  ((org.apache.logging.log4j.core.Logger)rootLogger).setLevel(Level.DEBUG);
 
 rootLogger.debug(This is a debug message from ROOT.);
 xLogger.debug(This is a debug message from X.);
 }
 
  }
 
 
  log4j-api-2.0-beta5.jar and log4j-core-2.0-beta4.jar are the only jars on
  the class path.  I'm using the same log4j2.xml file as above.
 
 
  When I run this program, I see the following output:
 
 
  2013-05-17 11:50:54,192 INFO  [main] {} Main.main(14) - This is an INFO
 log
  message.
 
  2013-05-17 11:50:54,194 DEBUG [main] {} Main.main(18) - This is a debug
  message from ROOT.
 
 
  The debug message from the X logger is missing.  Shouldn't the X logger
 be
  inheriting the level from the Root Logger since an explicit level has not
  been set?
 
 
  Thanks,
 
  -Eric
 
 
 
 
  On Thu, May 16, 2013 at 11:49 PM, Ralph Goers 
 ralph.go...@dslextreme.comwrote:
 
  Can you provide a sample application that demonstrates this?
 
  Ralph
 
  On May 16, 2013, at 9:44 PM, Eric Scheie wrote:
 
  I'm developing a web application and would like to be able to
 dynamically
  change log levels from within my application instead of editing the
  log4j2
  configuration file.   I'm using log4j 2.0 beta5.
 
  I'm currently setting the log level after a form submit using:
 
  ((org.apache.logging.log4j.core.Logger)
 LogManager.getLogger(LogManager.
  ROOT_LOGGER_NAME)).setLevel(Level.X);
 
 
  And when I call:
 
 
  ((org.apache.logging.log4j.core.Logger)
 LogManager.getLogger(LogManager.
  ROOT_LOGGER_NAME)).getLevel()
 
 
  I get the level that I previously set as expected but I don't see the
  level
  reflected in the logs.  For example, when changing the level to DEBUG
 on
  the root logger I do not see debug messages written to the console.
  If I
  change the level of the root logger in my log4j2.xml configuration
 file I
  do see the debug messages written to the console.
 
 
  Here is my log4j2.xml file.
 
 
  ?xml version=1.0 encoding=UTF-8?
 
  configuration status=DEBUG monitorInterval=10
 
 
appenders
 
Console name=Console target=SYSTEM_OUT
 
PatternLayout pattern=%d %-5p [%t] %X %C{2}.%M(%L) -
 %m%n/
 
/Console
 
/appenders
 
 
loggers
 
root level=INFO
 
appender-ref ref=Console/
 
/root
 
/loggers
 
  /configuration
 
 
  Any ideas I how I can change the root logger level after startup
  programmtically?  I've been searching the web but the only things that
  come
  up are related to log4j 1.2, I haven't found anything applicable to
 log4j
  2.0.
 
 
  Thanks,
 
  -Eric
 
 
  -
  To unsubscribe, e-mail: log4j-user-unsubscr...@logging.apache.org
  For additional commands, e-mail: log4j-user-h...@logging.apache.org
 
 




Chainsaw support for java.util.logging file format

2013-05-03 Thread Scott Deboy
For those who may be interested, Chainsaw has been updated to include
support for multi-line log file formats, including the default
java.util.logging file format.

If you want to try it out, the developer snapshot of Chainsaw, in Mac dmg
or zip file format, is available at
http://people.apache.org/~sdeboy

If you want to try out Chainsaw's ability to parse and tail a
java.util.logging-formatted file, follow these steps:

 - start Chainsaw
 - Select the 'File, Load Chainsaw configuration' menu
 - Select 'process a log file'
 - Select the log file you want to parse by pressing the 'Open File' button
and browsing to the file
 - Log file format: TIMESTAMP LOGGER THREAD(LF)LEVEL: MESSAGE
 - Log file timestamp format: MMM dd,  HH:mm:ss a

You may want to check the box at the bottom to tell Chainsaw to always run
with this configuration, or save it off for later use.

Feedback always welcome!

Scott Deboy


Re: apache-chainsaw snapshot download

2013-03-01 Thread Scott Deboy
Hi Yogi,

I don't think the Chainsaw snapshot is published to maven..you have to
build it yourself...


On Fri, Mar 1, 2013 at 12:29 PM, Yogi Nerella ynerella...@gmail.com wrote:

 Hi,

 I cant find a central repository which is hosting
 apache-chainsaw-2.1.0.SNAPSHOT?

 Can anyone give sample settings.xml to download from the repository?

 Thanks
 Yogi



Re: Any tools to convert log messages to log events

2013-02-27 Thread Scott Deboy
I posted this in an earlier reply, but along with the declaration of the
repositoryselector from my previous email, do this:

VFSLogFilePatternReceiver receiver = new VFSLogFilePatternReceiver();
receiver.setAppendNonMatches(true);
receiver.setFileURL(info.getPropertyString(fileURI));
receiver.setLogFormat(LogFilePatternLayoutBuilder.getLogFormatFromPatternLayout(info.getPropertyString(format)));
receiver.setTimestampFormat(LogFilePatternLayoutBuilder.getTimeStampFormat(info.getPropertyString(format)));
receiver.setName(name + -receiver);
receiver.activateOptions();

That should do it..

Yes, it's trying to match the whole line...and the 'appendnonmatches' means
you'll still get a loggingevent, but with the entire line in the 'message'
field with an 'Unknown' logger.

Are you saying LogFilePatternReceiver regexp logic is not matching the
entry when aaa or bbb are empty strings? If so, I'd hope that'd be a bug we
could fix..

I'm not sure on the receiver side how you could use log4j2..it is coded
against log4j 1.2.x...you can use log4j2 on the appender side - this
receiver doesn't care where the log file came from (could be another
logging framework of course).

You're welcome!

Scott



On Wed, Feb 27, 2013 at 12:51 PM, Yogi Nerella ynerella...@gmail.comwrote:

 Scott,

 Thanks for pointing, I am now able to parse the log file and generate the
 events.

 I have couple of question for you.

 How do I configure log4j plugin via java code, instead of loading from an
 xml file?
 When the data matches partially with the regex, can the error message
 indicate upto what pattern it matched, and what is missing?
%p %t %l %d aaa=%X{aaa} bbb=%X{bbb}  %m

 If the data is missing aaa, can it report that, or if the datetime is not
 in the order it expected.

 Current program is constructing one big regular expression and doing a
 match, may be it should do is keyword by keyword and report at the first
 failure.

 Another question is How do I use this with log4j2, can I remove log4j1.2.16
 jar and then use log4j binding of 2.0 module?

 Appreciate your help,
 Yogi



 On Tue, Feb 26, 2013 at 3:33 PM, Scott Deboy scott.de...@gmail.com
 wrote:

  Chainsaw does this:
 
private static final LoggerRepositoryExImpl repositoryExImpl = new
  LoggerRepositoryExImpl(LogManager.getLoggerRepository());
 
  Which I think you also need to do prior to calling activateOptions on the
  receiver..
 
  Scott
 
  On Tue, Feb 26, 2013 at 2:52 PM, Yogi Nerella ynerella...@gmail.com
  wrote:
 
   Hi Scott,
  
   After I got download the jar files from your repository, I run into
   NullPointerException?
  
   doPost()
   Logger localLogger =
   getLoggerRepository().getLogger(event.getLoggerName());
  
  
   getLoggerRepository() is returning null?   What am I doing wrong?
  
   I am attaching the java code I am using and the log4j.xml file.
  
   Thanks
   Yogi
  
  
  
  
  
   On Tue, Feb 26, 2013 at 11:19 AM, Scott Deboy scott.de...@gmail.com
  wrote:
  
   Yikes!!!
  
   Thanks for pointing this out..
  
   I'll send an email to the dev list, hopefully someone will know how to
   resolve it.
  
   Scott
  
  
   On Tue, Feb 26, 2013 at 11:09 AM, Yogi Nerella ynerella...@gmail.com
   wrote:
  
Scott,
   
first of all, I would like to appreciate your time.
   
None of the mirrors has this zip file available.  I have tried
  probably
   10
of them.
   
Downloaded source code from SVN REPOSITORY, but it fails in tests.
Failed tests:
   testLocationInfo(org.apache.log4j.xml.XSLTLayoutTestCase)
  testBasic(org.apache.log4j.xml.XSLTLayoutTestCase)
  testCDATA(org.apache.log4j.xml.XSLTLayoutTestCase)
  testNull(org.apache.log4j.xml.XSLTLayoutTestCase)
   
   
All these mirrors do not have the file.   But archive repository has
   it, so
I downloaded it.
   
   
   
  
 
 http://www.apache.org/dyn/closer.cgi/logging/log4j/companions/extras/1.1/apache-log4j-extras-1.1.tar.gz
   
*
   
   
  
 
 http://www.globalish.com/am/logging/log4j/companions/extras/1.1/apache-log4j-extras-1.1.tar.gz
*
   
  
 
 http://www.globalish.com/am/logging/log4j/companions/extras/1.1/apache-log4j-extras-1.1.tar.gz

   
   
*
   
   
  
 
 http://apache.mirrors.lucidnetworks.net/logging/log4j/companions/extras/1.1/apache-log4j-extras-1.1.tar.gz
*
   
  
 
 http://apache.mirrors.lucidnetworks.net/logging/log4j/companions/extras/1.1/apache-log4j-extras-1.1.tar.gz

   
   
*
   
   
  
 
 http://www.carfab.com/apachesoftware/logging/log4j/companions/extras/1.1/apache-log4j-extras-1.1.tar.gz
*
   
  
 
 http://www.carfab.com/apachesoftware/logging/log4j/companions/extras/1.1/apache-log4j-extras-1.1.tar.gz

   
   
*
   
   
  
 
 http://apache.tradebit.com/pub/logging/log4j/companions/extras/1.1/apache-log4j-extras-1.1.tar.gz
*
   
  
 
 http://apache.tradebit.com/pub/logging/log4j/companions/extras/1.1/apache-log4j-extras-1.1.tar.gz

Re: Any tools to convert log messages to log events

2013-02-27 Thread Scott Deboy
I'm sorry, there was one more chunk of code to use the repositoryExImpl:

  private static final Object repositorySelectorGuard = new Object();
  private static final LoggerRepositoryExImpl repositoryExImpl = new
LoggerRepositoryExImpl(LogManager.getLoggerRepository());

Then, somewhere prior to initializing the receiver:

LogManager.setRepositorySelector(new RepositorySelector() {

public LoggerRepository getLoggerRepository() {
return repositoryExImpl;
}}, repositorySelectorGuard);

And then, your receiver initialization code should work without issues.

To find out which events have 'aaa' or 'bbb' missing, you could use the
'filterExpression' field of the receiver to only receive events from the
file which don't contain aaa or bbb properties:

receiver.setFilterExpression((! (prop.aaa exists) || (! (prop.bbb
exists)));

Of course, you can do all of this with Chainsaw if you'd like :)

Scott


On Wed, Feb 27, 2013 at 1:38 PM, Yogi Nerella ynerella...@gmail.com wrote:

 Scott,

 This code is failing with NullPointerException for the doPost() method.

 I get the NullPointerException even when static initialization of the
 following code is done.
 private static final LoggerRepositoryExImpl repositoryExImpl = new
 LoggerRepositoryExImpl(LogManager.getLoggerRepository());


 I think we have to set LoggerRepositoryExImpl this as the new
 rootRepository(), but I do not know what API to use.   the only other api I
 can use is doConfigure(entity, repository);

 Our application do not have contexts in all the threads some threads add
 context (aaa),  some add  both (aaa  bbb).  I would like to report the
 errors pointing out which context is missing.

 Also, some log files are using the date pattern that ends with a dot.sss
  and some with comma,sss, and these lines are also ending up with no
 match, would like to report the error properly.

 I was interested in log4j2 on the appender side only, so I can try and see
 if it is working ok.

 Thanks,
 Yogi


 On Wed, Feb 27, 2013 at 1:08 PM, Scott Deboy scott.de...@gmail.com
 wrote:

  I posted this in an earlier reply, but along with the declaration of the
  repositoryselector from my previous email, do this:
 
  VFSLogFilePatternReceiver receiver = new VFSLogFilePatternReceiver();
  receiver.setAppendNonMatches(true);
  receiver.setFileURL(info.getPropertyString(fileURI));
 
 
 receiver.setLogFormat(LogFilePatternLayoutBuilder.getLogFormatFromPatternLayout(info.getPropertyString(format)));
 
 
 receiver.setTimestampFormat(LogFilePatternLayoutBuilder.getTimeStampFormat(info.getPropertyString(format)));
  receiver.setName(name + -receiver);
  receiver.activateOptions();
 
  That should do it..
 
  Yes, it's trying to match the whole line...and the 'appendnonmatches'
 means
  you'll still get a loggingevent, but with the entire line in the
 'message'
  field with an 'Unknown' logger.
 
  Are you saying LogFilePatternReceiver regexp logic is not matching the
  entry when aaa or bbb are empty strings? If so, I'd hope that'd be a bug
 we
  could fix..
 
  I'm not sure on the receiver side how you could use log4j2..it is coded
  against log4j 1.2.x...you can use log4j2 on the appender side - this
  receiver doesn't care where the log file came from (could be another
  logging framework of course).
 
  You're welcome!
 
  Scott
 
 
 
  On Wed, Feb 27, 2013 at 12:51 PM, Yogi Nerella ynerella...@gmail.com
  wrote:
 
   Scott,
  
   Thanks for pointing, I am now able to parse the log file and generate
 the
   events.
  
   I have couple of question for you.
  
   How do I configure log4j plugin via java code, instead of loading from
 an
   xml file?
   When the data matches partially with the regex, can the error message
   indicate upto what pattern it matched, and what is missing?
  %p %t %l %d aaa=%X{aaa} bbb=%X{bbb}  %m
  
   If the data is missing aaa, can it report that, or if the datetime is
 not
   in the order it expected.
  
   Current program is constructing one big regular expression and doing a
   match, may be it should do is keyword by keyword and report at the
 first
   failure.
  
   Another question is How do I use this with log4j2, can I remove
  log4j1.2.16
   jar and then use log4j binding of 2.0 module?
  
   Appreciate your help,
   Yogi
  
  
  
   On Tue, Feb 26, 2013 at 3:33 PM, Scott Deboy scott.de...@gmail.com
   wrote:
  
Chainsaw does this:
   
  private static final LoggerRepositoryExImpl repositoryExImpl = new
LoggerRepositoryExImpl(LogManager.getLoggerRepository());
   
Which I think you also need to do prior to calling activateOptions on
  the
receiver..
   
Scott
   
On Tue, Feb 26, 2013 at 2:52 PM, Yogi Nerella ynerella...@gmail.com
 
wrote:
   
 Hi Scott,

 After I got download the jar files from your repository, I run into
 NullPointerException?

 doPost()
 Logger localLogger =

  getLoggerRepository().getLogger(event.getLoggerName

Re: Any tools to convert log messages to log events

2013-02-26 Thread Scott Deboy
The link I referenced:
http://logging.apache.org/log4j/companions/extras/

Has a 'download' link on the right hand side.

Scott


On Tue, Feb 26, 2013 at 10:17 AM, Yogi Nerella ynerella...@gmail.comwrote:

 Scott,

 None of the apache sites has extras available for download?

 Yogi


 On Mon, Feb 25, 2013 at 9:41 PM, Scott Deboy scott.de...@gmail.com
 wrote:

  Maybe you are hitting a typo?  It's VFSLogFilePatternReceiver (not
  VSLogFilePatternReceiver) and can be found in the Chainsaw binaries.  I'd
  suggest pulling down the latest developer snapshot at
  http://people.apache.org/~sdeboy
 
  Also, the OptionHandler class is a part of the log4j extras companion
  release (http://logging.apache.org/log4j/companions/extras/)
 
  Scott
 
 
 
 
  On Mon, Feb 25, 2013 at 6:00 PM, Yogi Nerella ynerella...@gmail.com
  wrote:
 
   Hi Scott,
  
   Running into several issues.
  
   1. VSLogFilePatternReceiver is not found in the chainsaw binaries.
 Only
   source code has this.
  
   2. Downloaded source code and built, this is missing
   org.apache.log4j.spi.OptionHandler
  
   Can you point me the correct place where I can download the chainsaw.
  
   Thanks
   Yogi
  
  
  
  
   On Sat, Feb 23, 2013 at 8:51 AM, Scott Deboy scott.de...@gmail.com
   wrote:
  
Yes, I would suggest adding non-space delimiters between fields
  (dashes)
   or
around fields (square brackets)...
   
   
On Sat, Feb 23, 2013 at 8:05 AM, Tech Mail ynerella...@gmail.com
   wrote:
   
 Thank you Ralph, Scott,

 Can (VFS)LogFilePatternReceiver this class be improved to accept
   pattern
 layout string as log format?  So that there is no error in manually
 changing the format?

 Also how does the headers, fields constructed back if the data
 itself
   has
 the field separators.

 Is there any field terminator I can provide in pattern layout
 instead
   of
 space?  Some times MDC context is empty and some times data in MDC
context
 has spaces which when reconstructed the fields has wrong data.  How
  do
   I
 handle this?

 Thanks,
 Yogi

 On Feb 22, 2013, at 11:42 PM, Ralph Goers 
  ralph.go...@dslextreme.com
 wrote:

  I think you are mistaken on the number of Appenders that are
  missing.
 
  Log4j 2 does have a SocketAppender. It supports both TCP and UDP
  and
 accepts a Layout to allow whatever is sent to be formatted any way
  you
 want.  The existing SocketServer expects a serialized event. The
XMLLayout
 could be used instead.  In fact, the SyslogAppender just extends
 the
 SocketAppender and hard codes the layout to match either the BSD or
  RFC
 5424 syslog layout.
 
  There are both a JMSTopicAppender and a JMSQueueAppender. There
 is
  a
 Receiver for each, although they probably don't conform to what you
   would
 want.
 
  Of course there is a FileAppender that accepts any layout. There
 is
   no
 Receiver.
 
  You are correct that there is currently not a DBAppender or
  Receiver.
 
  I don't know what it means to say Log4j 2 doesn't have non-Log4j
  1.x
 appenders.
 
  When I started working on Log4j 2 I don't recall any of the
  receivers
 being part of the codebase but in some companion layer. I have no
   problem
 with having them being added.
 
  If you really feel something is missing you are welcome to commit
  it.
 
  Ralph
 
  On Feb 22, 2013, at 4:58 PM, Scott Deboy wrote:
 
  I forgot the two main socket appenders of course:
  SocketAppender - SocketReceiver
  SocketHubAppender - SocketHubReceiver (allow reverse-connects
  from
the
  'receiver' to the 'appender')
 
 
  On Fri, Feb 22, 2013 at 4:51 PM, Scott Deboy 
  scott.de...@gmail.com
   
 wrote:
 
  There are quite a few appenders and associated receivers in
 log4j
1.x.
  Most of these appenders and all of these receivers are missing
 in
 log4j2:
 
  MulticastAppender-MulticastReceiver
  UDPAppender and non-log4j appenders which support generating
  events
 over
  UDP which conform to log4j's dtd (log4net, etc)-UDPReceiver
  *FileAppender with a regular text
   layout-(VFS)LogFilePatternReceiver
  *FileAppender with an xml layout-LogFileXMLReceiver
  non-log4j appenders which support generating events over TCP
  which
 conform
  to log4j's dtd (log4perl, etc)-XMLSocketReceiver
  JMSAppender-JMSReceiver
  DBAppender-DBReceiver (DBAppender uses a predefined schema)
  Custom DB definition-CustomSQLDBReceiver
 
  There may be others, those are the ones I can remember off the
  top
   of
 my
  head.
 
  Scott
 
 
  On Fri, Feb 22, 2013 at 4:44 PM, Scott Deboy 
   scott.de...@gmail.com
 wrote:
 
  In log4j1.x, yes, receivers can be configured via the 'plugin'
 element

Re: Any tools to convert log messages to log events

2013-02-26 Thread Scott Deboy
Err left hand side :)


On Tue, Feb 26, 2013 at 10:38 AM, Scott Deboy scott.de...@gmail.com wrote:

 The link I referenced:
 http://logging.apache.org/log4j/companions/extras/

 Has a 'download' link on the right hand side.

 Scott


 On Tue, Feb 26, 2013 at 10:17 AM, Yogi Nerella ynerella...@gmail.comwrote:

 Scott,

 None of the apache sites has extras available for download?

 Yogi


 On Mon, Feb 25, 2013 at 9:41 PM, Scott Deboy scott.de...@gmail.com
 wrote:

  Maybe you are hitting a typo?  It's VFSLogFilePatternReceiver (not
  VSLogFilePatternReceiver) and can be found in the Chainsaw binaries.
  I'd
  suggest pulling down the latest developer snapshot at
  http://people.apache.org/~sdeboy
 
  Also, the OptionHandler class is a part of the log4j extras companion
  release (http://logging.apache.org/log4j/companions/extras/)
 
  Scott
 
 
 
 
  On Mon, Feb 25, 2013 at 6:00 PM, Yogi Nerella ynerella...@gmail.com
  wrote:
 
   Hi Scott,
  
   Running into several issues.
  
   1. VSLogFilePatternReceiver is not found in the chainsaw binaries.
 Only
   source code has this.
  
   2. Downloaded source code and built, this is missing
   org.apache.log4j.spi.OptionHandler
  
   Can you point me the correct place where I can download the chainsaw.
  
   Thanks
   Yogi
  
  
  
  
   On Sat, Feb 23, 2013 at 8:51 AM, Scott Deboy scott.de...@gmail.com
   wrote:
  
Yes, I would suggest adding non-space delimiters between fields
  (dashes)
   or
around fields (square brackets)...
   
   
On Sat, Feb 23, 2013 at 8:05 AM, Tech Mail ynerella...@gmail.com
   wrote:
   
 Thank you Ralph, Scott,

 Can (VFS)LogFilePatternReceiver this class be improved to accept
   pattern
 layout string as log format?  So that there is no error in
 manually
 changing the format?

 Also how does the headers, fields constructed back if the data
 itself
   has
 the field separators.

 Is there any field terminator I can provide in pattern layout
 instead
   of
 space?  Some times MDC context is empty and some times data in MDC
context
 has spaces which when reconstructed the fields has wrong data.
  How
  do
   I
 handle this?

 Thanks,
 Yogi

 On Feb 22, 2013, at 11:42 PM, Ralph Goers 
  ralph.go...@dslextreme.com
 wrote:

  I think you are mistaken on the number of Appenders that are
  missing.
 
  Log4j 2 does have a SocketAppender. It supports both TCP and UDP
  and
 accepts a Layout to allow whatever is sent to be formatted any way
  you
 want.  The existing SocketServer expects a serialized event. The
XMLLayout
 could be used instead.  In fact, the SyslogAppender just extends
 the
 SocketAppender and hard codes the layout to match either the BSD
 or
  RFC
 5424 syslog layout.
 
  There are both a JMSTopicAppender and a JMSQueueAppender. There
 is
  a
 Receiver for each, although they probably don't conform to what
 you
   would
 want.
 
  Of course there is a FileAppender that accepts any layout.
 There is
   no
 Receiver.
 
  You are correct that there is currently not a DBAppender or
  Receiver.
 
  I don't know what it means to say Log4j 2 doesn't have non-Log4j
  1.x
 appenders.
 
  When I started working on Log4j 2 I don't recall any of the
  receivers
 being part of the codebase but in some companion layer. I have no
   problem
 with having them being added.
 
  If you really feel something is missing you are welcome to
 commit
  it.
 
  Ralph
 
  On Feb 22, 2013, at 4:58 PM, Scott Deboy wrote:
 
  I forgot the two main socket appenders of course:
  SocketAppender - SocketReceiver
  SocketHubAppender - SocketHubReceiver (allow reverse-connects
  from
the
  'receiver' to the 'appender')
 
 
  On Fri, Feb 22, 2013 at 4:51 PM, Scott Deboy 
  scott.de...@gmail.com
   
 wrote:
 
  There are quite a few appenders and associated receivers in
 log4j
1.x.
  Most of these appenders and all of these receivers are
 missing in
 log4j2:
 
  MulticastAppender-MulticastReceiver
  UDPAppender and non-log4j appenders which support generating
  events
 over
  UDP which conform to log4j's dtd (log4net, etc)-UDPReceiver
  *FileAppender with a regular text
   layout-(VFS)LogFilePatternReceiver
  *FileAppender with an xml layout-LogFileXMLReceiver
  non-log4j appenders which support generating events over TCP
  which
 conform
  to log4j's dtd (log4perl, etc)-XMLSocketReceiver
  JMSAppender-JMSReceiver
  DBAppender-DBReceiver (DBAppender uses a predefined schema)
  Custom DB definition-CustomSQLDBReceiver
 
  There may be others, those are the ones I can remember off the
  top
   of
 my
  head.
 
  Scott
 
 
  On Fri, Feb 22, 2013 at 4:44 PM, Scott Deboy 
   scott.de...@gmail.com

Re: Any tools to convert log messages to log events

2013-02-26 Thread Scott Deboy
Yikes!!!

Thanks for pointing this out..

I'll send an email to the dev list, hopefully someone will know how to
resolve it.

Scott


On Tue, Feb 26, 2013 at 11:09 AM, Yogi Nerella ynerella...@gmail.comwrote:

 Scott,

 first of all, I would like to appreciate your time.

 None of the mirrors has this zip file available.  I have tried probably 10
 of them.

 Downloaded source code from SVN REPOSITORY, but it fails in tests.
 Failed tests:   testLocationInfo(org.apache.log4j.xml.XSLTLayoutTestCase)
   testBasic(org.apache.log4j.xml.XSLTLayoutTestCase)
   testCDATA(org.apache.log4j.xml.XSLTLayoutTestCase)
   testNull(org.apache.log4j.xml.XSLTLayoutTestCase)


 All these mirrors do not have the file.   But archive repository has it, so
 I downloaded it.


 http://www.apache.org/dyn/closer.cgi/logging/log4j/companions/extras/1.1/apache-log4j-extras-1.1.tar.gz

 *

 http://www.globalish.com/am/logging/log4j/companions/extras/1.1/apache-log4j-extras-1.1.tar.gz
 *
 http://www.globalish.com/am/logging/log4j/companions/extras/1.1/apache-log4j-extras-1.1.tar.gz
 


 *

 http://apache.mirrors.lucidnetworks.net/logging/log4j/companions/extras/1.1/apache-log4j-extras-1.1.tar.gz
 *
 http://apache.mirrors.lucidnetworks.net/logging/log4j/companions/extras/1.1/apache-log4j-extras-1.1.tar.gz
 


 *

 http://www.carfab.com/apachesoftware/logging/log4j/companions/extras/1.1/apache-log4j-extras-1.1.tar.gz
 *
 http://www.carfab.com/apachesoftware/logging/log4j/companions/extras/1.1/apache-log4j-extras-1.1.tar.gz
 


 *

 http://apache.tradebit.com/pub/logging/log4j/companions/extras/1.1/apache-log4j-extras-1.1.tar.gz
 *
 http://apache.tradebit.com/pub/logging/log4j/companions/extras/1.1/apache-log4j-extras-1.1.tar.gz
 


 *

 http://apache.mirrors.hoobly.com/logging/log4j/companions/extras/1.1/apache-log4j-extras-1.1.tar.gz
 *
 http://apache.mirrors.hoobly.com/logging/log4j/companions/extras/1.1/apache-log4j-extras-1.1.tar.gz
 


 *

 http://mirror.olnevhost.net/pub/apache/logging/log4j/companions/extras/1.1/apache-log4j-extras-1.1.tar.gz
 *
 http://mirror.olnevhost.net/pub/apache/logging/log4j/companions/extras/1.1/apache-log4j-extras-1.1.tar.gz
 


 *

 http://download.nextag.com/apache/logging/log4j/companions/extras/1.1/apache-log4j-extras-1.1.tar.gz
 *
 http://download.nextag.com/apache/logging/log4j/companions/extras/1.1/apache-log4j-extras-1.1.tar.gz
 


 *

 http://www.eng.lsu.edu/mirrors/apache/logging/log4j/companions/extras/1.1/apache-log4j-extras-1.1.tar.gz
 *
 http://www.eng.lsu.edu/mirrors/apache/logging/log4j/companions/extras/1.1/apache-log4j-extras-1.1.tar.gz
 


 *

 http://www.trieuvan.com/apache/logging/log4j/companions/extras/1.1/apache-log4j-extras-1.1.tar.gz
 *
 http://www.trieuvan.com/apache/logging/log4j/companions/extras/1.1/apache-log4j-extras-1.1.tar.gz
 


 *

 http://www.fightrice.com/mirrors/apache/logging/log4j/companions/extras/1.1/apache-log4j-extras-1.1.tar.gz
 *
 http://www.fightrice.com/mirrors/apache/logging/log4j/companions/extras/1.1/apache-log4j-extras-1.1.tar.gz
 


 *

 http://mirror.reverse.net/pub/apache/logging/log4j/companions/extras/1.1/apache-log4j-extras-1.1.tar.gz
 *
 http://mirror.reverse.net/pub/apache/logging/log4j/companions/extras/1.1/apache-log4j-extras-1.1.tar.gz
 


 *

 http://apache.mirrors.pair.com/logging/log4j/companions/extras/1.1/apache-log4j-extras-1.1.tar.gz
 *
 http://apache.mirrors.pair.com/logging/log4j/companions/extras/1.1/apache-log4j-extras-1.1.tar.gz
 


 Yogi


 On Tue, Feb 26, 2013 at 10:38 AM, Scott Deboy scott.de...@gmail.com
 wrote:

  Err left hand side :)
 
 
  On Tue, Feb 26, 2013 at 10:38 AM, Scott Deboy scott.de...@gmail.com
  wrote:
 
   The link I referenced:
   http://logging.apache.org/log4j/companions/extras/
  
   Has a 'download' link on the right hand side.
  
   Scott
  
  
   On Tue, Feb 26, 2013 at 10:17 AM, Yogi Nerella ynerella...@gmail.com
  wrote:
  
   Scott,
  
   None of the apache sites has extras available for download?
  
   Yogi
  
  
   On Mon, Feb 25, 2013 at 9:41 PM, Scott Deboy scott.de...@gmail.com
   wrote:
  
Maybe you are hitting a typo?  It's VFSLogFilePatternReceiver (not
VSLogFilePatternReceiver) and can be found in the Chainsaw binaries.
I'd
suggest pulling down the latest developer snapshot at
http://people.apache.org/~sdeboy
   
Also, the OptionHandler class is a part of the log4j extras
 companion
release (http://logging.apache.org/log4j/companions/extras/)
   
Scott
   
   
   
   
On Mon, Feb 25, 2013 at 6:00 PM, Yogi Nerella 
 ynerella...@gmail.com
wrote:
   
 Hi Scott,

 Running into several issues.

 1. VSLogFilePatternReceiver is not found in the chainsaw binaries.
   Only
 source code has this.

 2. Downloaded source code and built, this is missing
 org.apache.log4j.spi.OptionHandler

 Can you point me the correct place where I can download the
  chainsaw.

 Thanks
 Yogi

Re: Any tools to convert log messages to log events

2013-02-26 Thread Scott Deboy
Chainsaw does this:

  private static final LoggerRepositoryExImpl repositoryExImpl = new
LoggerRepositoryExImpl(LogManager.getLoggerRepository());

Which I think you also need to do prior to calling activateOptions on the
receiver..

Scott

On Tue, Feb 26, 2013 at 2:52 PM, Yogi Nerella ynerella...@gmail.com wrote:

 Hi Scott,

 After I got download the jar files from your repository, I run into
 NullPointerException?

 doPost()
 Logger localLogger =
 getLoggerRepository().getLogger(event.getLoggerName());


 getLoggerRepository() is returning null?   What am I doing wrong?

 I am attaching the java code I am using and the log4j.xml file.

 Thanks
 Yogi





 On Tue, Feb 26, 2013 at 11:19 AM, Scott Deboy scott.de...@gmail.comwrote:

 Yikes!!!

 Thanks for pointing this out..

 I'll send an email to the dev list, hopefully someone will know how to
 resolve it.

 Scott


 On Tue, Feb 26, 2013 at 11:09 AM, Yogi Nerella ynerella...@gmail.com
 wrote:

  Scott,
 
  first of all, I would like to appreciate your time.
 
  None of the mirrors has this zip file available.  I have tried probably
 10
  of them.
 
  Downloaded source code from SVN REPOSITORY, but it fails in tests.
  Failed tests:
 testLocationInfo(org.apache.log4j.xml.XSLTLayoutTestCase)
testBasic(org.apache.log4j.xml.XSLTLayoutTestCase)
testCDATA(org.apache.log4j.xml.XSLTLayoutTestCase)
testNull(org.apache.log4j.xml.XSLTLayoutTestCase)
 
 
  All these mirrors do not have the file.   But archive repository has
 it, so
  I downloaded it.
 
 
 
 http://www.apache.org/dyn/closer.cgi/logging/log4j/companions/extras/1.1/apache-log4j-extras-1.1.tar.gz
 
  *
 
 
 http://www.globalish.com/am/logging/log4j/companions/extras/1.1/apache-log4j-extras-1.1.tar.gz
  *
 
 http://www.globalish.com/am/logging/log4j/companions/extras/1.1/apache-log4j-extras-1.1.tar.gz
  
 
 
  *
 
 
 http://apache.mirrors.lucidnetworks.net/logging/log4j/companions/extras/1.1/apache-log4j-extras-1.1.tar.gz
  *
 
 http://apache.mirrors.lucidnetworks.net/logging/log4j/companions/extras/1.1/apache-log4j-extras-1.1.tar.gz
  
 
 
  *
 
 
 http://www.carfab.com/apachesoftware/logging/log4j/companions/extras/1.1/apache-log4j-extras-1.1.tar.gz
  *
 
 http://www.carfab.com/apachesoftware/logging/log4j/companions/extras/1.1/apache-log4j-extras-1.1.tar.gz
  
 
 
  *
 
 
 http://apache.tradebit.com/pub/logging/log4j/companions/extras/1.1/apache-log4j-extras-1.1.tar.gz
  *
 
 http://apache.tradebit.com/pub/logging/log4j/companions/extras/1.1/apache-log4j-extras-1.1.tar.gz
  
 
 
  *
 
 
 http://apache.mirrors.hoobly.com/logging/log4j/companions/extras/1.1/apache-log4j-extras-1.1.tar.gz
  *
 
 http://apache.mirrors.hoobly.com/logging/log4j/companions/extras/1.1/apache-log4j-extras-1.1.tar.gz
  
 
 
  *
 
 
 http://mirror.olnevhost.net/pub/apache/logging/log4j/companions/extras/1.1/apache-log4j-extras-1.1.tar.gz
  *
 
 http://mirror.olnevhost.net/pub/apache/logging/log4j/companions/extras/1.1/apache-log4j-extras-1.1.tar.gz
  
 
 
  *
 
 
 http://download.nextag.com/apache/logging/log4j/companions/extras/1.1/apache-log4j-extras-1.1.tar.gz
  *
 
 http://download.nextag.com/apache/logging/log4j/companions/extras/1.1/apache-log4j-extras-1.1.tar.gz
  
 
 
  *
 
 
 http://www.eng.lsu.edu/mirrors/apache/logging/log4j/companions/extras/1.1/apache-log4j-extras-1.1.tar.gz
  *
 
 http://www.eng.lsu.edu/mirrors/apache/logging/log4j/companions/extras/1.1/apache-log4j-extras-1.1.tar.gz
  
 
 
  *
 
 
 http://www.trieuvan.com/apache/logging/log4j/companions/extras/1.1/apache-log4j-extras-1.1.tar.gz
  *
 
 http://www.trieuvan.com/apache/logging/log4j/companions/extras/1.1/apache-log4j-extras-1.1.tar.gz
  
 
 
  *
 
 
 http://www.fightrice.com/mirrors/apache/logging/log4j/companions/extras/1.1/apache-log4j-extras-1.1.tar.gz
  *
 
 http://www.fightrice.com/mirrors/apache/logging/log4j/companions/extras/1.1/apache-log4j-extras-1.1.tar.gz
  
 
 
  *
 
 
 http://mirror.reverse.net/pub/apache/logging/log4j/companions/extras/1.1/apache-log4j-extras-1.1.tar.gz
  *
 
 http://mirror.reverse.net/pub/apache/logging/log4j/companions/extras/1.1/apache-log4j-extras-1.1.tar.gz
  
 
 
  *
 
 
 http://apache.mirrors.pair.com/logging/log4j/companions/extras/1.1/apache-log4j-extras-1.1.tar.gz
  *
 
 http://apache.mirrors.pair.com/logging/log4j/companions/extras/1.1/apache-log4j-extras-1.1.tar.gz
  
 
 
  Yogi
 
 
  On Tue, Feb 26, 2013 at 10:38 AM, Scott Deboy scott.de...@gmail.com
  wrote:
 
   Err left hand side :)
  
  
   On Tue, Feb 26, 2013 at 10:38 AM, Scott Deboy scott.de...@gmail.com
   wrote:
  
The link I referenced:
http://logging.apache.org/log4j/companions/extras/
   
Has a 'download' link on the right hand side.
   
Scott
   
   
On Tue, Feb 26, 2013 at 10:17 AM, Yogi Nerella 
 ynerella...@gmail.com
   wrote:
   
Scott,
   
None of the apache sites has extras available for download?
   
Yogi
   
   
On Mon, Feb 25, 2013 at 9:41 PM, Scott Deboy 
 scott.de

Re: Any tools to convert log messages to log events

2013-02-25 Thread Scott Deboy
Maybe you are hitting a typo?  It's VFSLogFilePatternReceiver (not
VSLogFilePatternReceiver) and can be found in the Chainsaw binaries.  I'd
suggest pulling down the latest developer snapshot at
http://people.apache.org/~sdeboy

Also, the OptionHandler class is a part of the log4j extras companion
release (http://logging.apache.org/log4j/companions/extras/)

Scott




On Mon, Feb 25, 2013 at 6:00 PM, Yogi Nerella ynerella...@gmail.com wrote:

 Hi Scott,

 Running into several issues.

 1. VSLogFilePatternReceiver is not found in the chainsaw binaries.   Only
 source code has this.

 2. Downloaded source code and built, this is missing
 org.apache.log4j.spi.OptionHandler

 Can you point me the correct place where I can download the chainsaw.

 Thanks
 Yogi




 On Sat, Feb 23, 2013 at 8:51 AM, Scott Deboy scott.de...@gmail.com
 wrote:

  Yes, I would suggest adding non-space delimiters between fields (dashes)
 or
  around fields (square brackets)...
 
 
  On Sat, Feb 23, 2013 at 8:05 AM, Tech Mail ynerella...@gmail.com
 wrote:
 
   Thank you Ralph, Scott,
  
   Can (VFS)LogFilePatternReceiver this class be improved to accept
 pattern
   layout string as log format?  So that there is no error in manually
   changing the format?
  
   Also how does the headers, fields constructed back if the data itself
 has
   the field separators.
  
   Is there any field terminator I can provide in pattern layout instead
 of
   space?  Some times MDC context is empty and some times data in MDC
  context
   has spaces which when reconstructed the fields has wrong data.  How do
 I
   handle this?
  
   Thanks,
   Yogi
  
   On Feb 22, 2013, at 11:42 PM, Ralph Goers ralph.go...@dslextreme.com
   wrote:
  
I think you are mistaken on the number of Appenders that are missing.
   
Log4j 2 does have a SocketAppender. It supports both TCP and UDP and
   accepts a Layout to allow whatever is sent to be formatted any way you
   want.  The existing SocketServer expects a serialized event. The
  XMLLayout
   could be used instead.  In fact, the SyslogAppender just extends the
   SocketAppender and hard codes the layout to match either the BSD or RFC
   5424 syslog layout.
   
There are both a JMSTopicAppender and a JMSQueueAppender. There is a
   Receiver for each, although they probably don't conform to what you
 would
   want.
   
Of course there is a FileAppender that accepts any layout. There is
 no
   Receiver.
   
You are correct that there is currently not a DBAppender or Receiver.
   
I don't know what it means to say Log4j 2 doesn't have non-Log4j 1.x
   appenders.
   
When I started working on Log4j 2 I don't recall any of the receivers
   being part of the codebase but in some companion layer. I have no
 problem
   with having them being added.
   
If you really feel something is missing you are welcome to commit it.
   
Ralph
   
On Feb 22, 2013, at 4:58 PM, Scott Deboy wrote:
   
I forgot the two main socket appenders of course:
SocketAppender - SocketReceiver
SocketHubAppender - SocketHubReceiver (allow reverse-connects from
  the
'receiver' to the 'appender')
   
   
On Fri, Feb 22, 2013 at 4:51 PM, Scott Deboy scott.de...@gmail.com
 
   wrote:
   
There are quite a few appenders and associated receivers in log4j
  1.x.
Most of these appenders and all of these receivers are missing in
   log4j2:
   
MulticastAppender-MulticastReceiver
UDPAppender and non-log4j appenders which support generating events
   over
UDP which conform to log4j's dtd (log4net, etc)-UDPReceiver
*FileAppender with a regular text
 layout-(VFS)LogFilePatternReceiver
*FileAppender with an xml layout-LogFileXMLReceiver
non-log4j appenders which support generating events over TCP which
   conform
to log4j's dtd (log4perl, etc)-XMLSocketReceiver
JMSAppender-JMSReceiver
DBAppender-DBReceiver (DBAppender uses a predefined schema)
Custom DB definition-CustomSQLDBReceiver
   
There may be others, those are the ones I can remember off the top
 of
   my
head.
   
Scott
   
   
On Fri, Feb 22, 2013 at 4:44 PM, Scott Deboy 
 scott.de...@gmail.com
   wrote:
   
In log4j1.x, yes, receivers can be configured via the 'plugin'
   element in
log4j.xml and eventually end up appending received events to the
  local
log4j system, which are then picked up by locally defined
 appenders.
This
is how Chainsaw works - it programmatically registers its own
   appender to
pull in events appended by the configured receivers.
   
   
   
   
   
On Fri, Feb 22, 2013 at 4:37 PM, Ralph Goers 
   ralph.go...@dslextreme.comwrote:
   
Not in the configuration as yet.   However, I've implemented a
   couple of
servers that are independent main programs that can receive
 log
   events.
I am assuming that the main difference is that the receiver would
   not be a
main but would be embedded in the application

Re: Any tools to convert log messages to log events

2013-02-23 Thread Scott Deboy
I overstated what appenders are missing:
 - fixed-schema and custom schema DB appenders
 - reverse-connect socket appender

There were also other appenders that never made it in because at the time
there were folks pushing relatively small contributions through the
incubator (soapappender, an IM/IRCAppender if I recall, etc)..

The non-log4j comments were added to point out that some of the existing
receivers are used by other logging frameworks to pull their events into
Chainsaw (or other tools)


On Fri, Feb 22, 2013 at 11:42 PM, Ralph Goers ralph.go...@dslextreme.comwrote:

 I think you are mistaken on the number of Appenders that are missing.

 Log4j 2 does have a SocketAppender. It supports both TCP and UDP and
 accepts a Layout to allow whatever is sent to be formatted any way you
 want.  The existing SocketServer expects a serialized event. The XMLLayout
 could be used instead.  In fact, the SyslogAppender just extends the
 SocketAppender and hard codes the layout to match either the BSD or RFC
 5424 syslog layout.

 There are both a JMSTopicAppender and a JMSQueueAppender. There is a
 Receiver for each, although they probably don't conform to what you would
 want.

 Of course there is a FileAppender that accepts any layout. There is no
 Receiver.

 You are correct that there is currently not a DBAppender or Receiver.

 I don't know what it means to say Log4j 2 doesn't have non-Log4j 1.x
 appenders.

 When I started working on Log4j 2 I don't recall any of the receivers
 being part of the codebase but in some companion layer. I have no problem
 with having them being added.

 If you really feel something is missing you are welcome to commit it.

 Ralph

 On Feb 22, 2013, at 4:58 PM, Scott Deboy wrote:

  I forgot the two main socket appenders of course:
  SocketAppender - SocketReceiver
  SocketHubAppender - SocketHubReceiver (allow reverse-connects from the
  'receiver' to the 'appender')
 
 
  On Fri, Feb 22, 2013 at 4:51 PM, Scott Deboy scott.de...@gmail.com
 wrote:
 
  There are quite a few appenders and associated receivers in log4j 1.x.
  Most of these appenders and all of these receivers are missing in
 log4j2:
 
  MulticastAppender-MulticastReceiver
  UDPAppender and non-log4j appenders which support generating events over
  UDP which conform to log4j's dtd (log4net, etc)-UDPReceiver
  *FileAppender with a regular text layout-(VFS)LogFilePatternReceiver
  *FileAppender with an xml layout-LogFileXMLReceiver
  non-log4j appenders which support generating events over TCP which
 conform
  to log4j's dtd (log4perl, etc)-XMLSocketReceiver
  JMSAppender-JMSReceiver
  DBAppender-DBReceiver (DBAppender uses a predefined schema)
  Custom DB definition-CustomSQLDBReceiver
 
  There may be others, those are the ones I can remember off the top of my
  head.
 
  Scott
 
 
  On Fri, Feb 22, 2013 at 4:44 PM, Scott Deboy scott.de...@gmail.com
 wrote:
 
  In log4j1.x, yes, receivers can be configured via the 'plugin' element
 in
  log4j.xml and eventually end up appending received events to the local
  log4j system, which are then picked up by locally defined appenders.
  This
  is how Chainsaw works - it programmatically registers its own appender
 to
  pull in events appended by the configured receivers.
 
 
 
 
 
  On Fri, Feb 22, 2013 at 4:37 PM, Ralph Goers 
 ralph.go...@dslextreme.comwrote:
 
  Not in the configuration as yet.   However, I've implemented a couple
 of
  servers that are independent main programs that can receive log
 events.
  I am assuming that the main difference is that the receiver would not
 be a
  main but would be embedded in the application.
 
  Where are they documented?
 
  Ralph
 
 
  On Feb 22, 2013, at 3:51 PM, Scott Deboy wrote:
 
  Log4j2 has no concept of receivers, correct?
 
 
  On Fri, Feb 22, 2013 at 3:39 PM, Ralph Goers 
  ralph.go...@dslextreme.comwrote:
 
  Scott,
 
  Yogi has been asking other questions about Log4j 2 so I'm not clear
  if his
  question applies to that or 1.x.  Or does the
  VFSLogFilePatternReceiver
  work with Log4j 2?
 
  Ralph
 
 
  On Feb 22, 2013, at 3:32 PM, Scott Deboy wrote:
 
  If you want the events to end up in log4j (being processed by an
  appender,
  it's very easy, just define a (VFS)LogFilePatternReceiver in your
  log4j
  configuration file.
 
  If you instead want the LogEvents so you can do something else with
  them,
  you can use the (VFS)LogFilePatternReceiver outside of log4j, just
  construct it, call appropriate setters, and call activateOptions.
  Wherever
  the receiver calls doPost, you can instead hold on to the generated
  event.
 
 
 
 
 http://svn.apache.org/repos/asf/logging/chainsaw/trunk/src/main/java/org/apache/log4j/varia/LogFilePatternReceiver.java
 
  The VFS version supports Commons-VFS sources (sftp, etc):
 
 
 
 http://svn.apache.org/repos/asf/logging/chainsaw/trunk/src/main/java/org/apache/log4j/chainsaw/vfs/VFSLogFilePatternReceiver.java
 
  Scott
 
 
  On Fri, Feb 22, 2013 at 2:23 PM, Yogi Nerella

Re: Any tools to convert log messages to log events

2013-02-23 Thread Scott Deboy
Yes, I would suggest adding non-space delimiters between fields (dashes) or
around fields (square brackets)...


On Sat, Feb 23, 2013 at 8:05 AM, Tech Mail ynerella...@gmail.com wrote:

 Thank you Ralph, Scott,

 Can (VFS)LogFilePatternReceiver this class be improved to accept pattern
 layout string as log format?  So that there is no error in manually
 changing the format?

 Also how does the headers, fields constructed back if the data itself has
 the field separators.

 Is there any field terminator I can provide in pattern layout instead of
 space?  Some times MDC context is empty and some times data in MDC context
 has spaces which when reconstructed the fields has wrong data.  How do I
 handle this?

 Thanks,
 Yogi

 On Feb 22, 2013, at 11:42 PM, Ralph Goers ralph.go...@dslextreme.com
 wrote:

  I think you are mistaken on the number of Appenders that are missing.
 
  Log4j 2 does have a SocketAppender. It supports both TCP and UDP and
 accepts a Layout to allow whatever is sent to be formatted any way you
 want.  The existing SocketServer expects a serialized event. The XMLLayout
 could be used instead.  In fact, the SyslogAppender just extends the
 SocketAppender and hard codes the layout to match either the BSD or RFC
 5424 syslog layout.
 
  There are both a JMSTopicAppender and a JMSQueueAppender. There is a
 Receiver for each, although they probably don't conform to what you would
 want.
 
  Of course there is a FileAppender that accepts any layout. There is no
 Receiver.
 
  You are correct that there is currently not a DBAppender or Receiver.
 
  I don't know what it means to say Log4j 2 doesn't have non-Log4j 1.x
 appenders.
 
  When I started working on Log4j 2 I don't recall any of the receivers
 being part of the codebase but in some companion layer. I have no problem
 with having them being added.
 
  If you really feel something is missing you are welcome to commit it.
 
  Ralph
 
  On Feb 22, 2013, at 4:58 PM, Scott Deboy wrote:
 
  I forgot the two main socket appenders of course:
  SocketAppender - SocketReceiver
  SocketHubAppender - SocketHubReceiver (allow reverse-connects from the
  'receiver' to the 'appender')
 
 
  On Fri, Feb 22, 2013 at 4:51 PM, Scott Deboy scott.de...@gmail.com
 wrote:
 
  There are quite a few appenders and associated receivers in log4j 1.x.
  Most of these appenders and all of these receivers are missing in
 log4j2:
 
  MulticastAppender-MulticastReceiver
  UDPAppender and non-log4j appenders which support generating events
 over
  UDP which conform to log4j's dtd (log4net, etc)-UDPReceiver
  *FileAppender with a regular text layout-(VFS)LogFilePatternReceiver
  *FileAppender with an xml layout-LogFileXMLReceiver
  non-log4j appenders which support generating events over TCP which
 conform
  to log4j's dtd (log4perl, etc)-XMLSocketReceiver
  JMSAppender-JMSReceiver
  DBAppender-DBReceiver (DBAppender uses a predefined schema)
  Custom DB definition-CustomSQLDBReceiver
 
  There may be others, those are the ones I can remember off the top of
 my
  head.
 
  Scott
 
 
  On Fri, Feb 22, 2013 at 4:44 PM, Scott Deboy scott.de...@gmail.com
 wrote:
 
  In log4j1.x, yes, receivers can be configured via the 'plugin'
 element in
  log4j.xml and eventually end up appending received events to the local
  log4j system, which are then picked up by locally defined appenders.
  This
  is how Chainsaw works - it programmatically registers its own
 appender to
  pull in events appended by the configured receivers.
 
 
 
 
 
  On Fri, Feb 22, 2013 at 4:37 PM, Ralph Goers 
 ralph.go...@dslextreme.comwrote:
 
  Not in the configuration as yet.   However, I've implemented a
 couple of
  servers that are independent main programs that can receive log
 events.
  I am assuming that the main difference is that the receiver would
 not be a
  main but would be embedded in the application.
 
  Where are they documented?
 
  Ralph
 
 
  On Feb 22, 2013, at 3:51 PM, Scott Deboy wrote:
 
  Log4j2 has no concept of receivers, correct?
 
 
  On Fri, Feb 22, 2013 at 3:39 PM, Ralph Goers 
  ralph.go...@dslextreme.comwrote:
 
  Scott,
 
  Yogi has been asking other questions about Log4j 2 so I'm not clear
  if his
  question applies to that or 1.x.  Or does the
  VFSLogFilePatternReceiver
  work with Log4j 2?
 
  Ralph
 
 
  On Feb 22, 2013, at 3:32 PM, Scott Deboy wrote:
 
  If you want the events to end up in log4j (being processed by an
  appender,
  it's very easy, just define a (VFS)LogFilePatternReceiver in your
  log4j
  configuration file.
 
  If you instead want the LogEvents so you can do something else
 with
  them,
  you can use the (VFS)LogFilePatternReceiver outside of log4j, just
  construct it, call appropriate setters, and call activateOptions.
  Wherever
  the receiver calls doPost, you can instead hold on to the
 generated
  event.
 
 http://svn.apache.org/repos/asf/logging/chainsaw/trunk/src/main/java/org/apache/log4j/varia/LogFilePatternReceiver.java
 
  The VFS version

Re: Any tools to convert log messages to log events

2013-02-22 Thread Scott Deboy
If you want the events to end up in log4j (being processed by an appender,
it's very easy, just define a (VFS)LogFilePatternReceiver in your log4j
configuration file.

If you instead want the LogEvents so you can do something else with them,
you can use the (VFS)LogFilePatternReceiver outside of log4j, just
construct it, call appropriate setters, and call activateOptions.  Wherever
the receiver calls doPost, you can instead hold on to the generated event.

http://svn.apache.org/repos/asf/logging/chainsaw/trunk/src/main/java/org/apache/log4j/varia/LogFilePatternReceiver.java

The VFS version supports Commons-VFS sources (sftp, etc):
http://svn.apache.org/repos/asf/logging/chainsaw/trunk/src/main/java/org/apache/log4j/chainsaw/vfs/VFSLogFilePatternReceiver.java

Scott


On Fri, Feb 22, 2013 at 2:23 PM, Yogi Nerella ynerella...@gmail.com wrote:

 Hi,

 Any tools which can take a log file and the pattern string and generate the
 events?

 Thanks
 Yogi



Re: Any tools to convert log messages to log events

2013-02-22 Thread Scott Deboy
Log4j2 has no concept of receivers, correct?


On Fri, Feb 22, 2013 at 3:39 PM, Ralph Goers ralph.go...@dslextreme.comwrote:

 Scott,

 Yogi has been asking other questions about Log4j 2 so I'm not clear if his
 question applies to that or 1.x.  Or does the VFSLogFilePatternReceiver
 work with Log4j 2?

 Ralph


 On Feb 22, 2013, at 3:32 PM, Scott Deboy wrote:

  If you want the events to end up in log4j (being processed by an
 appender,
  it's very easy, just define a (VFS)LogFilePatternReceiver in your log4j
  configuration file.
 
  If you instead want the LogEvents so you can do something else with them,
  you can use the (VFS)LogFilePatternReceiver outside of log4j, just
  construct it, call appropriate setters, and call activateOptions.
  Wherever
  the receiver calls doPost, you can instead hold on to the generated
 event.
 
 
 http://svn.apache.org/repos/asf/logging/chainsaw/trunk/src/main/java/org/apache/log4j/varia/LogFilePatternReceiver.java
 
  The VFS version supports Commons-VFS sources (sftp, etc):
 
 http://svn.apache.org/repos/asf/logging/chainsaw/trunk/src/main/java/org/apache/log4j/chainsaw/vfs/VFSLogFilePatternReceiver.java
 
  Scott
 
 
  On Fri, Feb 22, 2013 at 2:23 PM, Yogi Nerella ynerella...@gmail.com
 wrote:
 
  Hi,
 
  Any tools which can take a log file and the pattern string and generate
 the
  events?
 
  Thanks
  Yogi
 


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




Re: Any tools to convert log messages to log events

2013-02-22 Thread Scott Deboy
In log4j1.x, yes, receivers can be configured via the 'plugin' element in
log4j.xml and eventually end up appending received events to the local
log4j system, which are then picked up by locally defined appenders.  This
is how Chainsaw works - it programmatically registers its own appender to
pull in events appended by the configured receivers.





On Fri, Feb 22, 2013 at 4:37 PM, Ralph Goers ralph.go...@dslextreme.comwrote:

 Not in the configuration as yet.   However, I've implemented a couple of
 servers that are independent main programs that can receive log events.
  I am assuming that the main difference is that the receiver would not be a
 main but would be embedded in the application.

 Where are they documented?

 Ralph


 On Feb 22, 2013, at 3:51 PM, Scott Deboy wrote:

  Log4j2 has no concept of receivers, correct?
 
 
  On Fri, Feb 22, 2013 at 3:39 PM, Ralph Goers ralph.go...@dslextreme.com
 wrote:
 
  Scott,
 
  Yogi has been asking other questions about Log4j 2 so I'm not clear if
 his
  question applies to that or 1.x.  Or does the VFSLogFilePatternReceiver
  work with Log4j 2?
 
  Ralph
 
 
  On Feb 22, 2013, at 3:32 PM, Scott Deboy wrote:
 
  If you want the events to end up in log4j (being processed by an
  appender,
  it's very easy, just define a (VFS)LogFilePatternReceiver in your log4j
  configuration file.
 
  If you instead want the LogEvents so you can do something else with
 them,
  you can use the (VFS)LogFilePatternReceiver outside of log4j, just
  construct it, call appropriate setters, and call activateOptions.
  Wherever
  the receiver calls doPost, you can instead hold on to the generated
  event.
 
 
 
 http://svn.apache.org/repos/asf/logging/chainsaw/trunk/src/main/java/org/apache/log4j/varia/LogFilePatternReceiver.java
 
  The VFS version supports Commons-VFS sources (sftp, etc):
 
 
 http://svn.apache.org/repos/asf/logging/chainsaw/trunk/src/main/java/org/apache/log4j/chainsaw/vfs/VFSLogFilePatternReceiver.java
 
  Scott
 
 
  On Fri, Feb 22, 2013 at 2:23 PM, Yogi Nerella ynerella...@gmail.com
  wrote:
 
  Hi,
 
  Any tools which can take a log file and the pattern string and
 generate
  the
  events?
 
  Thanks
  Yogi
 
 
 
  -
  To unsubscribe, e-mail: log4j-user-unsubscr...@logging.apache.org
  For additional commands, e-mail: log4j-user-h...@logging.apache.org
 
 


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




Re: Any tools to convert log messages to log events

2013-02-22 Thread Scott Deboy
There are quite a few appenders and associated receivers in log4j 1.x.
 Most of these appenders and all of these receivers are missing in log4j2:

MulticastAppender-MulticastReceiver
UDPAppender and non-log4j appenders which support generating events over
UDP which conform to log4j's dtd (log4net, etc)-UDPReceiver
*FileAppender with a regular text layout-(VFS)LogFilePatternReceiver
*FileAppender with an xml layout-LogFileXMLReceiver
non-log4j appenders which support generating events over TCP which conform
to log4j's dtd (log4perl, etc)-XMLSocketReceiver
JMSAppender-JMSReceiver
DBAppender-DBReceiver (DBAppender uses a predefined schema)
Custom DB definition-CustomSQLDBReceiver

There may be others, those are the ones I can remember off the top of my
head.

Scott


On Fri, Feb 22, 2013 at 4:44 PM, Scott Deboy scott.de...@gmail.com wrote:

 In log4j1.x, yes, receivers can be configured via the 'plugin' element in
 log4j.xml and eventually end up appending received events to the local
 log4j system, which are then picked up by locally defined appenders.  This
 is how Chainsaw works - it programmatically registers its own appender to
 pull in events appended by the configured receivers.





 On Fri, Feb 22, 2013 at 4:37 PM, Ralph Goers 
 ralph.go...@dslextreme.comwrote:

 Not in the configuration as yet.   However, I've implemented a couple of
 servers that are independent main programs that can receive log events.
  I am assuming that the main difference is that the receiver would not be a
 main but would be embedded in the application.

 Where are they documented?

 Ralph


 On Feb 22, 2013, at 3:51 PM, Scott Deboy wrote:

  Log4j2 has no concept of receivers, correct?
 
 
  On Fri, Feb 22, 2013 at 3:39 PM, Ralph Goers 
 ralph.go...@dslextreme.comwrote:
 
  Scott,
 
  Yogi has been asking other questions about Log4j 2 so I'm not clear if
 his
  question applies to that or 1.x.  Or does the VFSLogFilePatternReceiver
  work with Log4j 2?
 
  Ralph
 
 
  On Feb 22, 2013, at 3:32 PM, Scott Deboy wrote:
 
  If you want the events to end up in log4j (being processed by an
  appender,
  it's very easy, just define a (VFS)LogFilePatternReceiver in your
 log4j
  configuration file.
 
  If you instead want the LogEvents so you can do something else with
 them,
  you can use the (VFS)LogFilePatternReceiver outside of log4j, just
  construct it, call appropriate setters, and call activateOptions.
  Wherever
  the receiver calls doPost, you can instead hold on to the generated
  event.
 
 
 
 http://svn.apache.org/repos/asf/logging/chainsaw/trunk/src/main/java/org/apache/log4j/varia/LogFilePatternReceiver.java
 
  The VFS version supports Commons-VFS sources (sftp, etc):
 
 
 http://svn.apache.org/repos/asf/logging/chainsaw/trunk/src/main/java/org/apache/log4j/chainsaw/vfs/VFSLogFilePatternReceiver.java
 
  Scott
 
 
  On Fri, Feb 22, 2013 at 2:23 PM, Yogi Nerella ynerella...@gmail.com
  wrote:
 
  Hi,
 
  Any tools which can take a log file and the pattern string and
 generate
  the
  events?
 
  Thanks
  Yogi
 
 
 
  -
  To unsubscribe, e-mail: log4j-user-unsubscr...@logging.apache.org
  For additional commands, e-mail: log4j-user-h...@logging.apache.org
 
 


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





Re: Any tools to convert log messages to log events

2013-02-22 Thread Scott Deboy
I forgot the two main socket appenders of course:
SocketAppender - SocketReceiver
SocketHubAppender - SocketHubReceiver (allow reverse-connects from the
'receiver' to the 'appender')


On Fri, Feb 22, 2013 at 4:51 PM, Scott Deboy scott.de...@gmail.com wrote:

 There are quite a few appenders and associated receivers in log4j 1.x.
  Most of these appenders and all of these receivers are missing in log4j2:

 MulticastAppender-MulticastReceiver
 UDPAppender and non-log4j appenders which support generating events over
 UDP which conform to log4j's dtd (log4net, etc)-UDPReceiver
 *FileAppender with a regular text layout-(VFS)LogFilePatternReceiver
 *FileAppender with an xml layout-LogFileXMLReceiver
 non-log4j appenders which support generating events over TCP which conform
 to log4j's dtd (log4perl, etc)-XMLSocketReceiver
 JMSAppender-JMSReceiver
 DBAppender-DBReceiver (DBAppender uses a predefined schema)
 Custom DB definition-CustomSQLDBReceiver

 There may be others, those are the ones I can remember off the top of my
 head.

 Scott


 On Fri, Feb 22, 2013 at 4:44 PM, Scott Deboy scott.de...@gmail.comwrote:

 In log4j1.x, yes, receivers can be configured via the 'plugin' element in
 log4j.xml and eventually end up appending received events to the local
 log4j system, which are then picked up by locally defined appenders.  This
 is how Chainsaw works - it programmatically registers its own appender to
 pull in events appended by the configured receivers.





 On Fri, Feb 22, 2013 at 4:37 PM, Ralph Goers 
 ralph.go...@dslextreme.comwrote:

 Not in the configuration as yet.   However, I've implemented a couple of
 servers that are independent main programs that can receive log events.
  I am assuming that the main difference is that the receiver would not be a
 main but would be embedded in the application.

 Where are they documented?

 Ralph


 On Feb 22, 2013, at 3:51 PM, Scott Deboy wrote:

  Log4j2 has no concept of receivers, correct?
 
 
  On Fri, Feb 22, 2013 at 3:39 PM, Ralph Goers 
 ralph.go...@dslextreme.comwrote:
 
  Scott,
 
  Yogi has been asking other questions about Log4j 2 so I'm not clear
 if his
  question applies to that or 1.x.  Or does the
 VFSLogFilePatternReceiver
  work with Log4j 2?
 
  Ralph
 
 
  On Feb 22, 2013, at 3:32 PM, Scott Deboy wrote:
 
  If you want the events to end up in log4j (being processed by an
  appender,
  it's very easy, just define a (VFS)LogFilePatternReceiver in your
 log4j
  configuration file.
 
  If you instead want the LogEvents so you can do something else with
 them,
  you can use the (VFS)LogFilePatternReceiver outside of log4j, just
  construct it, call appropriate setters, and call activateOptions.
  Wherever
  the receiver calls doPost, you can instead hold on to the generated
  event.
 
 
 
 http://svn.apache.org/repos/asf/logging/chainsaw/trunk/src/main/java/org/apache/log4j/varia/LogFilePatternReceiver.java
 
  The VFS version supports Commons-VFS sources (sftp, etc):
 
 
 http://svn.apache.org/repos/asf/logging/chainsaw/trunk/src/main/java/org/apache/log4j/chainsaw/vfs/VFSLogFilePatternReceiver.java
 
  Scott
 
 
  On Fri, Feb 22, 2013 at 2:23 PM, Yogi Nerella ynerella...@gmail.com
 
  wrote:
 
  Hi,
 
  Any tools which can take a log file and the pattern string and
 generate
  the
  events?
 
  Thanks
  Yogi
 
 
 
  -
  To unsubscribe, e-mail: log4j-user-unsubscr...@logging.apache.org
  For additional commands, e-mail: log4j-user-h...@logging.apache.org
 
 


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






Re: Log4j Extras ExpressionFilter issue

2012-10-04 Thread Scott Deboy
Hey Jake

I tried this in the latest developer snapshot of Chainsaw..I pulled up a
log in Chainsaw which contained info and debug entries (I didn't have a log
with trace).

And I added your URL value you provided in the 'marker' field of two of my
INFO entries

This expression:

(level = debug) || (level == info  prop.marker == '
https://somedomain/somepath/somepage.do?someparam=somevalamp;anotherparam=anotherval
')

Gave me all of the debug entries and two info level entries..

It could be something weird with trace...or something weird with parsing
the amp; ??? but...this should work..

Scott


On Wed, Oct 3, 2012 at 8:56 AM, Jacob Kjome h...@visi.com wrote:


 Thanks Scott,

 However, while I didn't experience an error in parsing the expression this
 time, the expression seems to be, at least partially, ignored.

 Below is the relevant config, where com.mypackage.MyClass sets MDC (via
 SLF4J) with a url key and the currently processed URL as the value, then
 logs the page content for the URL at the TRACE level (with MDC removal of
 url immediately after logging the page content).  But rather than getting
 TRACE output for only the URL defined in the Expression, I get **all**
 TRACE output.  It's like it sees the LEVEL == TRACE but then ignores the
 .  Thoughts?


 appender name=default class=org.apache.log4j.**
 rolling.RollingFileAppender
 ...

 filter class=org.apache.log4j.**filter.ExpressionFilter
 param name=Expression
value=( LEVEL = DEBUG ) || ( LEVEL == TRACE
 amp;amp; PROP.url == 'https://somedomain/somepath/**
 somepage.do?someparam=someval**amp;anotherparam=anothervalhttps://somedomain/somepath/somepage.do?someparam=somevalanotherparam=anotherval'
 )/
 /filter
 /appender

 logger name=com.mypackage.MyClass
 level value=TRACE/
 /logger

 root
 level value=WARN/
 appender-ref ref=default/
 /root



 On Tue, 2 Oct 2012 15:53:57 -0700
  Scott Deboy scott.de...@gmail.com wrote:

 Try PROP.url == 'blah'

 MDC entries are really just set as properties of the log4j events.

 Scott

 On Tue, Oct 2, 2012 at 1:10 PM, Jacob Kjome h...@visi.com wrote:


 I'm trying to use the ExpressionFilter [1] from Log4j Extras to limit
 logging for a particular appender to those cases where MDC contains a
 url
 entry that equals some specific value.  But I get an error from Log4j
 saying Invalid EQUALS rule - MDC.url is not a supported field (see
 below
 for complete error output from Log4j).  I'm using the latest versions of
 Log4j-1.x and Log4j-extras.  Here's the relevant config...

 appender...
  
  filter class=org.apache.log4j.filter.ExpressionFilter

  param name=Expression value=MDC.url == '
 http://somedomain/somepath'/

  /filter
 /appender

 Based on the documentation [2] and commit comment [3] I found, it seems
 like this should work.  What am I missing?


 Here's the complete error output from Log4j...

 log4j:ERROR Could not create an Appender. Reported error follows.
 java.lang.IllegalArgumentException: Invalid EQUALS rule - MDC.url is
 not a supported field
  at org.apache.log4j.rule.EqualsRule.init(EqualsRule.***
 *java:62)
  at org.apache.log4j.rule.EqualsRule.getRule(EqualsRule.
 java:100)
  at org.apache.log4j.rule.EqualsRule.getRule(EqualsRule.
 java:85)
  at org.apache.log4j.rule.RuleFactory.getRule(**
 RuleFactory.java:154)
  at org.apache.log4j.rule.ExpressionRule$**
 PostFixExpressionCompiler.compileExpression(
 ExpressionRule.java:149)
  at org.apache.log4j.rule.ExpressionRule.getRule(**
 ExpressionRule.java:100)
  at org.apache.log4j.filter.ExpressionFilter.
 activateOptions(**
 ExpressionFilter.java:95)
  at org.apache.log4j.config.PropertySetter.activate(**
 PropertySetter.java:307)
  at org.apache.log4j.xml.DOMConfigurator.parseFilters(
 DOMConfigurator.java:380)
  at org.apache.log4j.xml.DOMConfigurator.parseAppender(
 DOMConfigurator.java:273)
  at org.apache.log4j.xml.DOMConfigurator.
 findAppenderByName(**
 DOMConfigurator.java:176)
  at org.apache.log4j.xml.DOMConfigurator.**
 findAppenderByReference(DOMConfigurator.java:191)
  at org.apache.log4j.xml.DOMConfigurator.**
 parseChildrenOfLoggerElement(DOMConfigurator.java:523)
  at org.apache.log4j.xml.DOMConfigurator.parseRoot(**
 DOMConfigurator.java:492)
  at org.apache.log4j.xml.DOMConfigurator.parse(**
 DOMConfigurator.java:1006)
  at org.apache.log4j.xml.DOMConfigurator.doConfigure(**
 DOMConfigurator.java:872)
  at org.apache.log4j.xml.DOMConfigurator.doConfigure(**
 DOMConfigurator.java:778)
  at org.apache.log4j.helpers.OptionConverter.**
 selectAndConfigure(OptionConverter.java:526)
  at org.apache.log4j.LogManager

Re: Log4j Extras ExpressionFilter issue

2012-10-02 Thread Scott Deboy
Try PROP.url == 'blah'

MDC entries are really just set as properties of the log4j events.

Scott

On Tue, Oct 2, 2012 at 1:10 PM, Jacob Kjome h...@visi.com wrote:


 I'm trying to use the ExpressionFilter [1] from Log4j Extras to limit
 logging for a particular appender to those cases where MDC contains a url
 entry that equals some specific value.  But I get an error from Log4j
 saying Invalid EQUALS rule - MDC.url is not a supported field (see below
 for complete error output from Log4j).  I'm using the latest versions of
 Log4j-1.x and Log4j-extras.  Here's the relevant config...

 appender...
 
 filter class=org.apache.log4j.**filter.ExpressionFilter
 param name=Expression value=MDC.url == '
 http://somedomain/somepath'/**
 /filter
 /appender

 Based on the documentation [2] and commit comment [3] I found, it seems
 like this should work.  What am I missing?


 Here's the complete error output from Log4j...

 log4j:ERROR Could not create an Appender. Reported error follows.
 java.lang.**IllegalArgumentException: Invalid EQUALS rule - MDC.url is
 not a supported field
 at org.apache.log4j.rule.**EqualsRule.init(EqualsRule.**java:62)
 at org.apache.log4j.rule.**EqualsRule.getRule(EqualsRule.**
 java:100)
 at org.apache.log4j.rule.**EqualsRule.getRule(EqualsRule.**
 java:85)
 at org.apache.log4j.rule.**RuleFactory.getRule(**
 RuleFactory.java:154)
 at org.apache.log4j.rule.**ExpressionRule$**
 PostFixExpressionCompiler.**compileExpression(**ExpressionRule.java:149)
 at org.apache.log4j.rule.**ExpressionRule.getRule(**
 ExpressionRule.java:100)
 at org.apache.log4j.filter.**ExpressionFilter.**activateOptions(**
 ExpressionFilter.java:95)
 at org.apache.log4j.config.**PropertySetter.activate(**
 PropertySetter.java:307)
 at org.apache.log4j.xml.**DOMConfigurator.parseFilters(**
 DOMConfigurator.java:380)
 at org.apache.log4j.xml.**DOMConfigurator.parseAppender(**
 DOMConfigurator.java:273)
 at org.apache.log4j.xml.**DOMConfigurator.**findAppenderByName(**
 DOMConfigurator.java:176)
 at org.apache.log4j.xml.**DOMConfigurator.**
 findAppenderByReference(**DOMConfigurator.java:191)
 at org.apache.log4j.xml.**DOMConfigurator.**
 parseChildrenOfLoggerElement(**DOMConfigurator.java:523)
 at org.apache.log4j.xml.**DOMConfigurator.parseRoot(**
 DOMConfigurator.java:492)
 at org.apache.log4j.xml.**DOMConfigurator.parse(**
 DOMConfigurator.java:1006)
 at org.apache.log4j.xml.**DOMConfigurator.doConfigure(**
 DOMConfigurator.java:872)
 at org.apache.log4j.xml.**DOMConfigurator.doConfigure(**
 DOMConfigurator.java:778)
 at org.apache.log4j.helpers.**OptionConverter.**
 selectAndConfigure(**OptionConverter.java:526)
 at org.apache.log4j.LogManager.**clinit(LogManager.java:127)
 at org.slf4j.impl.**Log4jLoggerFactory.getLogger(**
 Log4jLoggerFactory.java:64)
 at org.slf4j.LoggerFactory.**getLogger(LoggerFactory.java:**270)
 at org.slf4j.LoggerFactory.**getLogger(LoggerFactory.java:**281)


 [1] http://logging.apache.org/**log4j/companions/extras/**
 apidocs/org/apache/log4j/**filter/ExpressionFilter.htmlhttp://logging.apache.org/log4j/companions/extras/apidocs/org/apache/log4j/filter/ExpressionFilter.html
 [2] https://logging.apache.org/**log4j/companions/extras/**
 apidocs/org/apache/log4j/spi/**LoggingEventFieldResolver.htmlhttps://logging.apache.org/log4j/companions/extras/apidocs/org/apache/log4j/spi/LoggingEventFieldResolver.html
 [3] http://mail-archives.apache.**org/mod_mbox/logging-log4j-**
 dev/200310.mbox/%**3C20031027083531.85866.qmail@**minotaur.apache.org%3Ehttp://mail-archives.apache.org/mod_mbox/logging-log4j-dev/200310.mbox/%3c20031027083531.85866.qm...@minotaur.apache.org%3E



 Jake

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




Re: Chainsaw update fails horridly

2012-09-05 Thread Scott Deboy
Apologies, we really really have to get a new release out the door.

The quick fix is to delete your $USER_HOME/.chainsaw folder (or if you are
having problems with only a certain tab, files with that tab's name in the
.chainsaw folder).

I would also suggest trying the developer snapshot from
http://people.apache.org/~sdeboy - it includes a ton of new features not
available in the current webstart version (Mac DMG and .zip available).

Scott

On Wed, Sep 5, 2012 at 5:46 AM, Christian Grobmeier grobme...@gmail.comwrote:

 On Wed, Sep 5, 2012 at 2:41 PM, Brett Randall javabr...@gmail.com wrote:
  Yeah the webstart version looks to have problems.  The webstart location
 in
  redirecting to
  http://logging.apache.org/chainsaw/chainsaw_20060302/webstart/ but the
  files there are dated July 2012.

 It is related to the move of the logging site to a new system (it is
 required by Apache infra).
 When I tried it, Chainsaw started and I was happy because I am not a
 Chainsaw user.
 Hopefully Scott can look into that issue as he is the Webstart-Guru
 and maybe can advise on a quic fix.

  My recommendation, if you need a working version fast, is to use the
  non-webstart snapshot version from
 
 http://people.apache.org/~sdeboy/apache-chainsaw-2.1.0-SNAPSHOT-standalone.zip
 .
   I've been happily pulling snapshots from that location for a while
  now.

 We should make this official soon. It depends on a release of Logging
 Companions which is a) overdue and b) ready to go.

 Cheers


 
  Best
  Brett
 
  On 5 September 2012 22:04, Christian Grobmeier grobme...@gmail.com
 wrote:
 
  David,
 
  are you using the webstart version of Chainsaw?
 
  Thanks
  Christian
 
  On Wed, Sep 5, 2012 at 2:02 PM, David Myers
  david.myers.scibearsp...@gmail.com wrote:
   Hello All,
  
   I can't help but write, I am exceedingly annoyed with Chainsaw at the
  moment.
  
   Each time I start up the application (over the last 2 days or so) I
   get a message about the current version not being the same as
   previously. This is not a problem.
  
   When I run the app, I select a simple receiver.
  
   In the main tabbed log window the views have only 2 columns Hostname
   and log4j.remote.source.info
  
   And there is no where to add to the column count!
   The same is also true of the principle chainsaw-log tab.
  
   It seems none of the menus work either, I can only close the app using
   the manager!
  
   A logging system that doesn't show any of the info that is in the log
   messages is about a usefull as a cuddly toy in a bar brawl !
  
   I know that I can remove the contens of the .chainsaw directory, but
   if I have to do this every morning,or each time I start, and then have
   to reset all my 'coloured columns' !
  
   I have no problem with updates, but this has got to have been a major
   error. I can't believe it is only me.
  
   David
  
   -
   To unsubscribe, e-mail: log4j-user-unsubscr...@logging.apache.org
   For additional commands, e-mail: log4j-user-h...@logging.apache.org
  
 
 
 
  --
  http://www.grobmeier.de
  https://www.timeandbill.de
 
  -
  To unsubscribe, e-mail: log4j-user-unsubscr...@logging.apache.org
  For additional commands, e-mail: log4j-user-h...@logging.apache.org
 
 



 --
 http://www.grobmeier.de
 https://www.timeandbill.de

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




Re: Chainsaw update fails horridly

2012-09-05 Thread Scott Deboy
You don't need to build it, run the chainsaw script from the subfolder of the 
target directory in the zip. 

Error logs would be very helpful. A bugzilla issue would be great.

Thanks

Scott

On Sep 5, 2012, at 7:55 AM, David Myers david.myers.scibearsp...@gmail.com 
wrote:

 @Scott
 
 I did try to get the developper snapshot some time ago, but gave up
 with unfathomable maven errors occuring all over the place!
 
 I guess I can try again.
 
 David
 
 On Wed, Sep 5, 2012 at 4:14 PM, Scott Deboy scott.de...@gmail.com wrote:
 Apologies, we really really have to get a new release out the door.
 
 The quick fix is to delete your $USER_HOME/.chainsaw folder (or if you are
 having problems with only a certain tab, files with that tab's name in the
 .chainsaw folder).
 
 I would also suggest trying the developer snapshot from
 http://people.apache.org/~sdeboy - it includes a ton of new features not
 available in the current webstart version (Mac DMG and .zip available).
 
 Scott
 
 On Wed, Sep 5, 2012 at 5:46 AM, Christian Grobmeier 
 grobme...@gmail.comwrote:
 
 On Wed, Sep 5, 2012 at 2:41 PM, Brett Randall javabr...@gmail.com wrote:
 Yeah the webstart version looks to have problems.  The webstart location
 in
 redirecting to
 http://logging.apache.org/chainsaw/chainsaw_20060302/webstart/ but the
 files there are dated July 2012.
 
 It is related to the move of the logging site to a new system (it is
 required by Apache infra).
 When I tried it, Chainsaw started and I was happy because I am not a
 Chainsaw user.
 Hopefully Scott can look into that issue as he is the Webstart-Guru
 and maybe can advise on a quic fix.
 
 My recommendation, if you need a working version fast, is to use the
 non-webstart snapshot version from
 
 http://people.apache.org/~sdeboy/apache-chainsaw-2.1.0-SNAPSHOT-standalone.zip
 .
 I've been happily pulling snapshots from that location for a while
 now.
 
 We should make this official soon. It depends on a release of Logging
 Companions which is a) overdue and b) ready to go.
 
 Cheers
 
 
 
 Best
 Brett
 
 On 5 September 2012 22:04, Christian Grobmeier grobme...@gmail.com
 wrote:
 
 David,
 
 are you using the webstart version of Chainsaw?
 
 Thanks
 Christian
 
 On Wed, Sep 5, 2012 at 2:02 PM, David Myers
 david.myers.scibearsp...@gmail.com wrote:
 Hello All,
 
 I can't help but write, I am exceedingly annoyed with Chainsaw at the
 moment.
 
 Each time I start up the application (over the last 2 days or so) I
 get a message about the current version not being the same as
 previously. This is not a problem.
 
 When I run the app, I select a simple receiver.
 
 In the main tabbed log window the views have only 2 columns Hostname
 and log4j.remote.source.info
 
 And there is no where to add to the column count!
 The same is also true of the principle chainsaw-log tab.
 
 It seems none of the menus work either, I can only close the app using
 the manager!
 
 A logging system that doesn't show any of the info that is in the log
 messages is about a usefull as a cuddly toy in a bar brawl !
 
 I know that I can remove the contens of the .chainsaw directory, but
 if I have to do this every morning,or each time I start, and then have
 to reset all my 'coloured columns' !
 
 I have no problem with updates, but this has got to have been a major
 error. I can't believe it is only me.
 
 David
 
 -
 To unsubscribe, e-mail: log4j-user-unsubscr...@logging.apache.org
 For additional commands, e-mail: log4j-user-h...@logging.apache.org
 
 
 
 
 --
 http://www.grobmeier.de
 https://www.timeandbill.de
 
 -
 To unsubscribe, e-mail: log4j-user-unsubscr...@logging.apache.org
 For additional commands, e-mail: log4j-user-h...@logging.apache.org
 
 
 
 
 
 --
 http://www.grobmeier.de
 https://www.timeandbill.de
 
 -
 To unsubscribe, e-mail: log4j-user-unsubscr...@logging.apache.org
 For additional commands, e-mail: log4j-user-h...@logging.apache.org
 
 
 
 -
 To unsubscribe, e-mail: log4j-user-unsubscr...@logging.apache.org
 For additional commands, e-mail: log4j-user-h...@logging.apache.org
 

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



Re: [2.X] Null object returned for root

2012-08-07 Thread Scott Deboy
Would be good to catch this and provide a more descriptive error in cases
like this as well.

On Tue, Aug 7, 2012 at 8:33 AM, Ralph Goers ralph.go...@dslextreme.comwrote:

 The configuration should work provided log.level is actually defined as a
 system property. If you set the status directly to debug I suspect you
 might see a bit more output.  I am going to have to create a unit test with
 this configuration and test it and I will get back to you asap.

 Ralph


 On Aug 7, 2012, at 7:06 AM, Simone Tripodi wrote:

  Hi Ralph!
 
  as mentioned in previous message, configuration file is on gist[1]
 
  many thanks in advance, all the best!!!
  -Simo
 
  [1] https://gist.github.com/3283384
 
  http://people.apache.org/~simonetripodi/
  http://simonetripodi.livejournal.com/
  http://twitter.com/simonetripodi
  http://www.99soft.org/
 
 
  On Tue, Aug 7, 2012 at 3:39 PM, Ralph Goers rgo...@apache.org wrote:
  Can you post your logging configuration file?  This error usually means
 it can't find a plugin for the object. That would be very odd for the root
 logger.
 
  Ralph
 
  Sent from my iPad
 
  On Aug 7, 2012, at 1:46 AM, Simone Tripodi simonetrip...@apache.org
 wrote:
 
  Hi all mates!
 
  Congrats first for the 2.0 release - even if alpha, this is something
  we all ASF friends were waiting for! :)
 
  I am now trying to migrate a small app from slf4j+logback to log4j2
  and I should have not understood well how new stuff work because I
  obtain the error as in the subject.
 
  This is my new log4j2.xml[1] file and then I just use the APIs.
 
  When the app starts, I get the following stacktrace:
 
  Null object returned for root
  Exception in thread main java.lang.NullPointerException
at
 org.apache.logging.log4j.core.config.BaseConfiguration.createPluginObject(BaseConfiguration.java:589)
at
 org.apache.logging.log4j.core.config.BaseConfiguration.createConfiguration(BaseConfiguration.java:452)
at
 org.apache.logging.log4j.core.config.BaseConfiguration.doConfigure(BaseConfiguration.java:148)
at
 org.apache.logging.log4j.core.config.BaseConfiguration.start(BaseConfiguration.java:108)
at
 org.apache.logging.log4j.core.LoggerContext.setConfiguration(LoggerContext.java:202)
at
 org.apache.logging.log4j.core.LoggerContext.reconfigure(LoggerContext.java:218)
at
 org.apache.logging.log4j.core.LoggerContext.start(LoggerContext.java:109)
at
 org.apache.logging.log4j.core.impl.Log4jContextFactory.getContext(Log4jContextFactory.java:81)
at
 org.apache.logging.log4j.core.impl.Log4jContextFactory.getContext(Log4jContextFactory.java:30)
at org.apache.logging.log4j.LogManager.getLogger(LogManager.java:129)
 
  What did I miss?
 
  Many thanks in advance, all the best!
  -Simo
 
  [1] https://gist.github.com/3283384
 
  http://people.apache.org/~simonetripodi/
  http://simonetripodi.livejournal.com/
  http://twitter.com/simonetripodi
  http://www.99soft.org/
 
  -
  To unsubscribe, e-mail: log4j-user-unsubscr...@logging.apache.org
  For additional commands, e-mail: log4j-user-h...@logging.apache.org
 
 
  -
  To unsubscribe, e-mail: log4j-user-unsubscr...@logging.apache.org
  For additional commands, e-mail: log4j-user-h...@logging.apache.org
 
 
  -
  To unsubscribe, e-mail: log4j-user-unsubscr...@logging.apache.org
  For additional commands, e-mail: log4j-user-h...@logging.apache.org
 


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




Re: Filter log based on package when using getLogger(String)

2012-07-18 Thread Scott Deboy
Correction: expression would use the LOGGER instead of MSG, since you're
filtering on that.

On Wed, Jul 18, 2012 at 10:54 AM, Scott Deboy scott.de...@gmail.com wrote:

 You can use filters, including the ExpressionFilter, to build pretty much
 arbitrary expressions and filter appenders using that, but it requires you
 to use a log4j.xml configuration file.

 Something like this (requires you to have the 'extras' companion in your
 classpath):

 filter class=org.apache.log4j.filter.ExpressionFilter
 param name=Expression value=MSG ~=
 #3/
 param name=AcceptOnMatch
 value=false/
 /filter
 Scott


 On Wed, Jul 18, 2012 at 10:26 AM, Charles Hache cha...@tsco.ca wrote:

 Hello folks,

 Most of my loggers are constructed with the Logger.getLogger(String)
 function, so that I can have loggers like Device(#3, Some Description)
 instead of ca.something.package.Device with the goal of being able to
 more easily identify which instances are writing what log lines.

 I've found that when I do this I can't use properties to filter the log
 level, such as
 log4j.logger.ca.something.**package=INFO
 I figure this is because if I use getLogger(Device.class) it gets the
 package of the logger from the class I give it and it all works from there.

 So this all makes sense, but brings up two questions:

 Can I still declare my loggers with a String name (getLogger(String)) and
 somehow still use package-style log level selection in the properties file?

 If not, do you guys have any tips on how to differentiate between
 instances when they're logging?  The obvious solution would be to prepend
 any log message I want to write with a description of the instance, but
 that seems like a lot of extra work.

 I think really what I'm looking for is something like getLogger(Class
 theClass, String theName), but maybe there is an already-implemented way to
 do this.

 Any tips?

 Regards,
 Charles

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





Re: FW: logfilepatternreceiver issue

2012-07-02 Thread Scott Deboy
Can you provide more information, including your configuration file and a
few lines from your log?

I'd suggest trying the latest developer snapshot and its ability to use an
existing fileappender definition from a log4j.xml or log4j.properties
file...

Developer snapshot is available here:

http://people.apache.org/~sdeboy

On Mon, Jun 25, 2012 at 1:19 PM, Tatiana Castano tgonza...@utiba.comwrote:


 Hi:

 I am trying to configure Chainsaw to see logs in a centOS machine. I been
 trying a while, but I do still receive this error.
 Someone can see what I am not able to?

 Regards,
 Tatiana Castano


 Properties {{hostname,chainsaw}{log4jid,110}{application,log}}
 Java.net.MalformedURLException
 At java.net.URL.(URL.java:617)
 At java.net.URL.(URL.java:480)
 At java.net.URL.(URL.java:429)
 Throwable at

 org.apache.log4j.varia.LogFilePatternReceiver$1.run(LogFilePatternReceveir.j
 ava:805)
 At java.lang.Thread.run(Thread.java:722)
 by: java.lang.NullPointerException
 At java.net.URL.(URL.java:522)
 Š 4 more





Re: ExpressionFilter in log4j.properties

2012-02-02 Thread Scott Deboy
I don't think you can define nested elements in the configuration file
format, which are usually where expressionfilters end up.  What are you
trying to define?

Scott

On Thu, Feb 2, 2012 at 1:24 AM, Ricardo Oliveira rvelo...@gmail.com wrote:

 Hello,

 Is there any way to configure expression filters in log4j.properties or we
 need to use log4j.xml?

 Cheers,

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




Re: Configuration Sequence

2012-02-02 Thread Scott Deboy
Order in the file doesn't really matter in either case it seems.

For a properties file, PropertyConfigurator does process entries in a
specific order, but it just finds them in the properties file and builds
the entries - here is the code from PropertyConfigurator:

configureRootCategory(properties, hierarchy);
configureLoggerFactory(properties);
parseCatsAndRenderers(properties, hierarchy);

For an xml file, the elements will be processed as they are defined in the
xml file - the DOMConfigurator code parses whatever is found in that order.

Scott

On Thu, Feb 2, 2012 at 5:19 AM, Stadelmann Josef 
josef.stadelm...@axa-winterthur.ch wrote:

 Looks as if nobody knows it ...

 well, I have the sources and can look myself,
 but I was so confident that a developer would know it :-(

 Josef

 -Ursprüngliche Nachricht-
 Von: Stadelmann Josef [mailto:josef.stadelm...@axa-winterthur.ch]
 Gesendet: Donnerstag, 26. Januar 2012 13:37
 An: log4j-user@logging.apache.org
 Betreff: Configuration Sequence

 I have a simpel question :

 what is the prioper sequence in configuring log4j.properties

 1.  logger
 2.  additivity
 3.  appenders
 4.  filters

 to reach that all gets parsed but not twice,

 if sequences are not correct, I see errors such as, in case of a rolling
 file appender
 file locked by another user, or in case of a Chainsaw sockethuappender,
 socket
 address already in use.

 What is the rule of dumb in configuration when tomcat startsup and has
 to deploy / lauch axis2.war

 Josef



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




Re: log4j - optional parameter

2012-01-05 Thread Scott Deboy
The feedback usually given is to use a different Logger named 'encryption'
and manage its logging threshold in the configuration file, so you can
control encryption logging separately from the other logger you are using
in this class.

On Wed, Jan 4, 2012 at 10:47 PM, lavsara sv_lava...@yahoo.com wrote:


 Hi,
 I need to add an optional parameter say Encryption=true to the
 consoleappender in log4j.properties file
 and in the Business class I need to check something like

 if  (encryption)
 {
 logger.debug(encrypt(message)); //encrypt() has the encryption logic.
 }

 I guess I have to extend consoleappender and have a getter/setter for
 encryption property.
 Is this a good approach? Or is there any other optimal way of acheiving
 this?

 Thanks,
 lavsara
 --
 View this message in context:
 http://old.nabble.com/log4j---optional-parameter-tp33084256p33084256.html
 Sent from the Log4j - Users mailing list archive at Nabble.com.


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




Re: Modifying the content to be shown in log files using properties files by blacklisting charters

2011-10-11 Thread Scott Deboy
Yes.  To use nested appenders like rewriteappender or asyncappender  
you need to use an XML formatted config file.


Scott



On Oct 11, 2011, at 3:43 AM, aanjaneya shukla  
shuklaaanjan...@gmail.com wrote:


I am currently using log4j.properties file. Does it mean I have to  
upgrade

all properties file into log4j.xml, then implement rewritepolicy?

On Mon, Oct 10, 2011 at 10:47 AM, Curt Arnold carn...@apache.org  
wrote:




On Oct 7, 2011, at 3:47 PM, Scott Deboy wrote:

RewritePolicy and RewriteAppender are included in the log4j  
receivers

companion (source only currently).



They are also in log4j, but only if built from the SVN source. They  
have

not been yet been included in a release.
-
To unsubscribe, e-mail: log4j-user-unsubscr...@logging.apache.org
For additional commands, e-mail: log4j-user-h...@logging.apache.org




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



Re: Modifying the content to be shown in log files using properties files by blacklisting charters

2011-10-07 Thread Scott Deboy
Yes it is possible to modify log messages before they are sent to an  
appender. Use a rewriteappender, implement you own rewritepolicy, and  
include an appender-ref to the destination appender in the  
rewriteappender definition along with the rewritepolicy.


Scott



On Oct 7, 2011, at 7:37 AM, aanjaneya shukla  
shuklaaanjan...@gmail.com wrote:



Hi,

To avoid log injection by newline charters, is it possible to modify
the contents of user defined messages in the log files? I want to
black list certain charters defined in the property file its with
adding any code to my framework.

Thanks,
Aanjaneya.

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



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



Re: Modifying the content to be shown in log files using properties files by blacklisting charters

2011-10-07 Thread Scott Deboy
appender name=F1 class=org.apache.log4j.FileAppender
   param name=file value=c:/temp/file.txt/
   param name=append value=false/
   layout class=org.apache.log4j.PatternLayout
 param name=ConversionPattern value=%p %c - p1:%X{p1}
p2:%X{p2} %m%n/
   /layout
 /appender


 appender name=A1 class=org.apache.log4j.rewrite.RewriteAppender
   appender-ref ref=F1/
   rewritePolicy class=org.apache.log4j.rewrite.PropertyRewritePolicy
 param name=properties value=p1=Hello,p2=World,x1=3.1415/
   /rewritePolicy
 /appender

   root
  level value=debug/
   appender-ref ref=A1 /
/root


You implement your own RewritePolicy and define its class in place of the
'PropertyRewritePolicy' and modify the loggingEvent in the rewrite method of
the RewritePolicy implementation..

Scott

On Fri, Oct 7, 2011 at 1:21 PM, aanjaneya shukla
shuklaaanjan...@gmail.comwrote:

 Can you please guide me to any examples, it would be lot quicker.

 Thanks,
 Aanjaneya

 On Fri, Oct 7, 2011 at 8:28 PM, Scott Deboy scott.de...@gmail.com wrote:
  Yes it is possible to modify log messages before they are sent to an
  appender. Use a rewriteappender, implement you own rewritepolicy, and
  include an appender-ref to the destination appender in the
 rewriteappender
  definition along with the rewritepolicy.
 
  Scott
 
 
 
  On Oct 7, 2011, at 7:37 AM, aanjaneya shukla shuklaaanjan...@gmail.com
  wrote:
 
  Hi,
 
  To avoid log injection by newline charters, is it possible to modify
  the contents of user defined messages in the log files? I want to
  black list certain charters defined in the property file its with
  adding any code to my framework.
 
  Thanks,
  Aanjaneya.
 
  -
  To unsubscribe, e-mail: log4j-user-unsubscr...@logging.apache.org
  For additional commands, e-mail: log4j-user-h...@logging.apache.org
 
 
  -
  To unsubscribe, e-mail: log4j-user-unsubscr...@logging.apache.org
  For additional commands, e-mail: log4j-user-h...@logging.apache.org
 
 

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




Re: Modifying the content to be shown in log files using properties files by blacklisting charters

2011-10-07 Thread Scott Deboy
RewritePolicy and RewriteAppender are included in the log4j receivers
companion (source only currently).

On Fri, Oct 7, 2011 at 1:45 PM, Scott Deboy scott.de...@gmail.com wrote:

 appender name=F1 class=org.apache.log4j.FileAppender
param name=file value=c:/temp/file.txt/
param name=append value=false/
layout class=org.apache.log4j.PatternLayout
  param name=ConversionPattern value=%p %c - p1:%X{p1} p2:%X{p2} 
 %m%n/
/layout
  /appender


  appender name=A1 class=org.apache.log4j.rewrite.RewriteAppender
appender-ref ref=F1/
rewritePolicy class=org.apache.log4j.rewrite.PropertyRewritePolicy
  param name=properties value=p1=Hello,p2=World,x1=3.1415/
/rewritePolicy
  /appender

root
   level value=debug/
appender-ref ref=A1 /
 /root


 You implement your own RewritePolicy and define its class in place of the
 'PropertyRewritePolicy' and modify the loggingEvent in the rewrite method of
 the RewritePolicy implementation..

 Scott


 On Fri, Oct 7, 2011 at 1:21 PM, aanjaneya shukla 
 shuklaaanjan...@gmail.com wrote:

 Can you please guide me to any examples, it would be lot quicker.

 Thanks,
 Aanjaneya

 On Fri, Oct 7, 2011 at 8:28 PM, Scott Deboy scott.de...@gmail.com
 wrote:
  Yes it is possible to modify log messages before they are sent to an
  appender. Use a rewriteappender, implement you own rewritepolicy, and
  include an appender-ref to the destination appender in the
 rewriteappender
  definition along with the rewritepolicy.
 
  Scott
 
 
 
  On Oct 7, 2011, at 7:37 AM, aanjaneya shukla shuklaaanjan...@gmail.com
 
  wrote:
 
  Hi,
 
  To avoid log injection by newline charters, is it possible to modify
  the contents of user defined messages in the log files? I want to
  black list certain charters defined in the property file its with
  adding any code to my framework.
 
  Thanks,
  Aanjaneya.
 
  -
  To unsubscribe, e-mail: log4j-user-unsubscr...@logging.apache.org
  For additional commands, e-mail: log4j-user-h...@logging.apache.org
 
 
  -
  To unsubscribe, e-mail: log4j-user-unsubscr...@logging.apache.org
  For additional commands, e-mail: log4j-user-h...@logging.apache.org
 
 

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





Re: log4j----Edit the event received

2011-09-19 Thread Scott Deboy
I haven't seen that issue before...you should be able to use any of the
configuration files in the test folder:

http://svn.apache.org/viewvc/logging/log4j/companions/receivers/trunk/src/test/resources/org/apache/log4j/rewrite/map.xml?revision=564831view=markup

On Mon, Sep 19, 2011 at 9:46 AM, Konduru, Geetha
geetha_kond...@medco.comwrote:

 I used the same log4j.xml I used by chainsaw in my application and
 exactly same classpath , than I get following exception.


 log4j:WARN Continuable parsing error 2 and column 82
 log4j:WARN Document root element log4j:configuration, must match
 DOCTYPE root null.
 log4j:WARN Continuable parsing error 2 and column 82
 log4j:WARN Document is invalid: no grammar found.


 Chainsaw config is.


 ?xml version=1.0 encoding=UTF-8?
 log4j:configuration xmlns:log4j=http://jakarta.apache.org/log4j/;
 debug=true
plugin class=org.apache.log4j.net.SocketReceiver
 name=SocketReceiver-12346
param name=active value=true/
param name=advertiseViaMulticastDNS value=false/
param name=class value=class
 org.apache.log4j.net.SocketReceiver/
param name=connectedSocketDetails value=[]/
param name=name value=SocketReceiver-12346/
param name=paused value=false/
param name=port value=12346/
param name=threshold value=TRACE/
/plugin
   appender name=F1 class=org.apache.log4j.FileAppender
param name=file value=c:/LogsDir/file.txt/
param name=append value=false/
   layout class=org.apache.log4j.PatternLayout
 param name=ConversionPattern value=%p %c - p1:%X{p1}
 p2:%X{p2} %m%n/
   /layout
 /appender


 appender name=A1
 class=org.apache.log4j.rewrite.RewriteAppender
   appender-ref ref=F1/
   rewritePolicy
 class=org.apache.log4j.rewrite.PropertyRewritePolicy
 param name=properties value=p1=Hello,p2=World,x1=3.1415/
   /rewritePolicy
 /appender

   root
  level value=debug/
   appender-ref ref=A1 /
/root

 /log4j:configuration

 This makes me to think that is chainsaw code responsible for making it
 to work???



 -Original Message-
 From: Scott Deboy [mailto:scott.de...@gmail.com]
 Sent: Friday, September 16, 2011 4:03 PM
 To: Log4J Users List
 Subject: Re: log4jEdit the event received

 In theory then, you should be able to add the entire chainsaw classpath
 to
 your application classpath and see it work..yes?

 On Fri, Sep 16, 2011 at 12:58 PM, Konduru, Geetha
 geetha_kond...@medco.comwrote:

  Just adding to last post , I am using log4j1.2.16 which is the one
 used
  by chainsaw application too...
 
  -Original Message-
  From: Konduru, Geetha [mailto:geetha_kond...@medco.com]
  Sent: Friday, September 16, 2011 3:26 PM
  To: Log4J Users List
  Subject: RE: log4jEdit the event received
 
  Even for me it is working on chainsaw side.
  But if I have this on my application side where I define
 SocketAppender
  , it is not working, I included components ,extras and receivers jars.
 
 
  Thank U,
  VGSS
 
  -Original Message-
  From: Scott Deboy [mailto:scott.de...@gmail.com]
  Sent: Friday, September 16, 2011 3:03 PM
  To: Log4J Users List
  Subject: Re: log4jEdit the event received
 
  I just tried this and it worked fineI modified the Chainsaw config
  file
  I was using (anything received by Chainsaw can also be sent to
 appenders
  defined in the same config)...configuration and example log file
 output
  below:
 
  Here's what I added to the Chainsaw config file:
appender name=F1 class=org.apache.log4j.FileAppender
param name=file value=c:/temp/file.txt/
param name=append value=false/
layout class=org.apache.log4j.PatternLayout
  param name=ConversionPattern value=%p %c - p1:%X{p1}
  p2:%X{p2}
  %m%n/
/layout
  /appender
 
 
  appender name=A1
  class=org.apache.log4j.rewrite.RewriteAppender
appender-ref ref=F1/
rewritePolicy
  class=org.apache.log4j.rewrite.PropertyRewritePolicy
  param name=properties value=p1=Hello,p2=World,x1=3.1415/
/rewritePolicy
  /appender
 
root
   level value=debug/
appender-ref ref=A1 /
 /root
 
  And here is an example output line:
  DEBUG Unknown - p1:Hello p2:World 20110916 09:16:16.870 NOTICE   RI-
  RI.DRI
   FATAL ERROR WARNING INFO
 
 
  On Fri, Sep 16, 2011 at 11:01 AM, Konduru, Geetha
  geetha_kond...@medco.comwrote:
 
   I tried this, its not working, following are warnings I get
  
  
  
  
  
   log4j:WARN Continuable parsing error 48 and column 80
  
   log4j:WARN Element type rewritePolicy must be declared.
  
   log4j:WARN Continuable parsing error 52 and column 14
  
   log4j:WARN The content of element type appender must match
  
 
 (errorHandler?,param*,rollingPolicy?,triggeringPolicy?,connectionSource
   ?,layout?,filter*,appender-ref*).
  
  
  
  
  
   Adding an Appender to RewriteAppender is working fine, but assigning

Re: log4j----Edit the event received

2011-09-19 Thread Scott Deboy
Can you try adding these two lines to the top of your config?

?xml version=1.0 encoding=UTF-8 ?
!DOCTYPE log4j:configuration SYSTEM log4j.dtd


Not sure why you're having this problem..

Scott

On Mon, Sep 19, 2011 at 10:19 AM, Konduru, Geetha
geetha_kond...@medco.comwrote:



 I used the config from following link exactly I still get following
 exception

 log4j:WARN Continuable parsing error 1 and column 69
 log4j:WARN Document root element log4j:configuration, must match
 DOCTYPE root null.
 log4j:WARN Continuable parsing error 1 and column 69
 log4j:WARN Document is invalid: no grammar found.



 It looks like parsing is different in chainsaw application from my
 Application, my classpath is exactly same.


 Weird!

 Thank U,
 VGSS
 -Original Message-
 From: Scott Deboy [mailto:scott.de...@gmail.com]
 Sent: Monday, September 19, 2011 1:13 PM
 To: Log4J Users List
 Subject: Re: log4jEdit the event received

 I haven't seen that issue before...you should be able to use any of the
 configuration files in the test folder:

 http://svn.apache.org/viewvc/logging/log4j/companions/receivers/trunk/sr
 c/test/resources/org/apache/log4j/rewrite/map.xml?revision=564831view=m
 arkup

 On Mon, Sep 19, 2011 at 9:46 AM, Konduru, Geetha
 geetha_kond...@medco.comwrote:

  I used the same log4j.xml I used by chainsaw in my application and
  exactly same classpath , than I get following exception.
 
 
  log4j:WARN Continuable parsing error 2 and column 82
  log4j:WARN Document root element log4j:configuration, must match
  DOCTYPE root null.
  log4j:WARN Continuable parsing error 2 and column 82
  log4j:WARN Document is invalid: no grammar found.
 
 
  Chainsaw config is.
 
 
  ?xml version=1.0 encoding=UTF-8?
  log4j:configuration xmlns:log4j=http://jakarta.apache.org/log4j/;
  debug=true
 plugin class=org.apache.log4j.net.SocketReceiver
  name=SocketReceiver-12346
 param name=active value=true/
 param name=advertiseViaMulticastDNS value=false/
 param name=class value=class
  org.apache.log4j.net.SocketReceiver/
 param name=connectedSocketDetails value=[]/
 param name=name value=SocketReceiver-12346/
 param name=paused value=false/
 param name=port value=12346/
 param name=threshold value=TRACE/
 /plugin
appender name=F1 class=org.apache.log4j.FileAppender
 param name=file value=c:/LogsDir/file.txt/
 param name=append value=false/
layout class=org.apache.log4j.PatternLayout
  param name=ConversionPattern value=%p %c - p1:%X{p1}
  p2:%X{p2} %m%n/
/layout
  /appender
 
 
  appender name=A1
  class=org.apache.log4j.rewrite.RewriteAppender
appender-ref ref=F1/
rewritePolicy
  class=org.apache.log4j.rewrite.PropertyRewritePolicy
  param name=properties value=p1=Hello,p2=World,x1=3.1415/
/rewritePolicy
  /appender
 
root
   level value=debug/
appender-ref ref=A1 /
 /root
 
  /log4j:configuration
 
  This makes me to think that is chainsaw code responsible for making it
  to work???
 
 
 
  -Original Message-
  From: Scott Deboy [mailto:scott.de...@gmail.com]
  Sent: Friday, September 16, 2011 4:03 PM
  To: Log4J Users List
  Subject: Re: log4jEdit the event received
 
  In theory then, you should be able to add the entire chainsaw
 classpath
  to
  your application classpath and see it work..yes?
 
  On Fri, Sep 16, 2011 at 12:58 PM, Konduru, Geetha
  geetha_kond...@medco.comwrote:
 
   Just adding to last post , I am using log4j1.2.16 which is the one
  used
   by chainsaw application too...
  
   -Original Message-
   From: Konduru, Geetha [mailto:geetha_kond...@medco.com]
   Sent: Friday, September 16, 2011 3:26 PM
   To: Log4J Users List
   Subject: RE: log4jEdit the event received
  
   Even for me it is working on chainsaw side.
   But if I have this on my application side where I define
  SocketAppender
   , it is not working, I included components ,extras and receivers
 jars.
  
  
   Thank U,
   VGSS
  
   -Original Message-
   From: Scott Deboy [mailto:scott.de...@gmail.com]
   Sent: Friday, September 16, 2011 3:03 PM
   To: Log4J Users List
   Subject: Re: log4jEdit the event received
  
   I just tried this and it worked fineI modified the Chainsaw
 config
   file
   I was using (anything received by Chainsaw can also be sent to
  appenders
   defined in the same config)...configuration and example log file
  output
   below:
  
   Here's what I added to the Chainsaw config file:
 appender name=F1 class=org.apache.log4j.FileAppender
 param name=file value=c:/temp/file.txt/
 param name=append value=false/
 layout class=org.apache.log4j.PatternLayout
   param name=ConversionPattern value=%p %c - p1:%X{p1}
   p2:%X{p2}
   %m%n/
 /layout
   /appender
  
  
   appender name=A1
   class

Re: log4j----Edit the event received

2011-09-19 Thread Scott Deboy
Do you have an old DTD in your classpath?

The log4j.dtd was updated to support 'plugin' back in rev 532603, Apr 2007.

Scott

On Mon, Sep 19, 2011 at 10:55 AM, Konduru, Geetha
geetha_kond...@medco.comwrote:

 Yes I did that, if I do that than it complaints about tag
 reWritePolicy and plugin...

 -Original Message-
 From: Scott Deboy [mailto:scott.de...@gmail.com]
 Sent: Monday, September 19, 2011 1:39 PM
 To: Log4J Users List
 Subject: Re: log4jEdit the event received

 Can you try adding these two lines to the top of your config?

 ?xml version=1.0 encoding=UTF-8 ?
 !DOCTYPE log4j:configuration SYSTEM log4j.dtd


 Not sure why you're having this problem..

 Scott

 On Mon, Sep 19, 2011 at 10:19 AM, Konduru, Geetha
 geetha_kond...@medco.comwrote:

 
 
  I used the config from following link exactly I still get
 following
  exception
 
  log4j:WARN Continuable parsing error 1 and column 69
  log4j:WARN Document root element log4j:configuration, must match
  DOCTYPE root null.
  log4j:WARN Continuable parsing error 1 and column 69
  log4j:WARN Document is invalid: no grammar found.
 
 
 
  It looks like parsing is different in chainsaw application from my
  Application, my classpath is exactly same.
 
 
  Weird!
 
  Thank U,
  VGSS
  -Original Message-
  From: Scott Deboy [mailto:scott.de...@gmail.com]
  Sent: Monday, September 19, 2011 1:13 PM
  To: Log4J Users List
  Subject: Re: log4jEdit the event received
 
  I haven't seen that issue before...you should be able to use any of
 the
  configuration files in the test folder:
 
 
 http://svn.apache.org/viewvc/logging/log4j/companions/receivers/trunk/sr
 
 c/test/resources/org/apache/log4j/rewrite/map.xml?revision=564831view=m
  arkup
 
  On Mon, Sep 19, 2011 at 9:46 AM, Konduru, Geetha
  geetha_kond...@medco.comwrote:
 
   I used the same log4j.xml I used by chainsaw in my application and
   exactly same classpath , than I get following exception.
  
  
   log4j:WARN Continuable parsing error 2 and column 82
   log4j:WARN Document root element log4j:configuration, must match
   DOCTYPE root null.
   log4j:WARN Continuable parsing error 2 and column 82
   log4j:WARN Document is invalid: no grammar found.
  
  
   Chainsaw config is.
  
  
   ?xml version=1.0 encoding=UTF-8?
   log4j:configuration xmlns:log4j=http://jakarta.apache.org/log4j/;
   debug=true
  plugin class=org.apache.log4j.net.SocketReceiver
   name=SocketReceiver-12346
  param name=active value=true/
  param name=advertiseViaMulticastDNS value=false/
  param name=class value=class
   org.apache.log4j.net.SocketReceiver/
  param name=connectedSocketDetails value=[]/
  param name=name value=SocketReceiver-12346/
  param name=paused value=false/
  param name=port value=12346/
  param name=threshold value=TRACE/
  /plugin
 appender name=F1 class=org.apache.log4j.FileAppender
  param name=file value=c:/LogsDir/file.txt/
  param name=append value=false/
 layout class=org.apache.log4j.PatternLayout
   param name=ConversionPattern value=%p %c - p1:%X{p1}
   p2:%X{p2} %m%n/
 /layout
   /appender
  
  
   appender name=A1
   class=org.apache.log4j.rewrite.RewriteAppender
 appender-ref ref=F1/
 rewritePolicy
   class=org.apache.log4j.rewrite.PropertyRewritePolicy
   param name=properties
 value=p1=Hello,p2=World,x1=3.1415/
 /rewritePolicy
   /appender
  
 root
level value=debug/
 appender-ref ref=A1 /
  /root
  
   /log4j:configuration
  
   This makes me to think that is chainsaw code responsible for making
 it
   to work???
  
  
  
   -Original Message-
   From: Scott Deboy [mailto:scott.de...@gmail.com]
   Sent: Friday, September 16, 2011 4:03 PM
   To: Log4J Users List
   Subject: Re: log4jEdit the event received
  
   In theory then, you should be able to add the entire chainsaw
  classpath
   to
   your application classpath and see it work..yes?
  
   On Fri, Sep 16, 2011 at 12:58 PM, Konduru, Geetha
   geetha_kond...@medco.comwrote:
  
Just adding to last post , I am using log4j1.2.16 which is the one
   used
by chainsaw application too...
   
-Original Message-
From: Konduru, Geetha [mailto:geetha_kond...@medco.com]
Sent: Friday, September 16, 2011 3:26 PM
To: Log4J Users List
Subject: RE: log4jEdit the event received
   
Even for me it is working on chainsaw side.
But if I have this on my application side where I define
   SocketAppender
, it is not working, I included components ,extras and receivers
  jars.
   
   
Thank U,
VGSS
   
-Original Message-
From: Scott Deboy [mailto:scott.de...@gmail.com]
Sent: Friday, September 16, 2011 3:03 PM
To: Log4J Users List
Subject: Re: log4jEdit the event received
   
I just tried this and it worked fine

Re: log4j----Edit the event received

2011-09-16 Thread Scott Deboy
Here is an example from the tests in log4j:

http://svn.apache.org/viewvc/logging/log4j/companions/receivers/trunk/src/test/resources/org/apache/log4j/rewrite/property.xml?view=markuppathrev=564831

 appender name=F1 class=org.apache.log4j.FileAppender
   param name=file value=temp/
   param name=append value=false/
   layout class=org.apache.log4j.PatternLayout
 param name=ConversionPattern value=%p %c - p1:%X{p1} p2:%X{p2}
%m%n/
   /layout
 /appender


 appender name=A1 class=org.apache.log4j.rewrite.RewriteAppender
   appender-ref ref=F1/
   rewritePolicy
class=org.apache.log4j.rewrite.PropertyRewritePolicy
 param name=properties value=p1=Hello,p2=World,x1=3.1415/
   /rewritePolicy
 /appender

 root
   level value =debug /
   appender-ref ref=A1 /
 /root

On Fri, Sep 16, 2011 at 8:49 AM, Konduru, Geetha
geetha_kond...@medco.comwrote:

 Would any one please give an example of xml configuration file with
 Rewrite Appender.

 Thank U,
 Vgss

 -Original Message-
 From: Konduru, Geetha [mailto:geetha_kond...@medco.com]
 Sent: Thursday, September 15, 2011 1:57 PM
 To: Log4J Users List
 Subject: RE: log4jEdit the event received

 log4j: Trying to find [server2Rewritelog4j.xml] using context
 classloader sun.misc.Launcher$AppClassLoader@601bb1.
 log4j: Using URL
 [file:/C:/EclipseWorkSpace/GemfireTest/bin/server2Rewritelog4j.xml] for
 automatic log4j configuration.
 log4j: Preferred configurator class:
 org.apache.log4j.xml.DOMConfigurator
 log4j: System property is :null
 log4j: Standard DocumentBuilderFactory search succeded.
 log4j: DocumentBuilderFactory is:
 com.sun.org.apache.xerces.internal.jaxp.DocumentBuilderFactoryImpl
 log4j:WARN Continuable parsing error 19 and column 97
 log4j:WARN Element type rewritePolicy must be declared.
 log4j:WARN Continuable parsing error 22 and column 12
 log4j:WARN The content of element type appender must match
 (errorHandler?,param*,rollingPolicy?,triggeringPolicy?,connectionSource
 ?,layout?,filter*,appender-ref*).
 log4j: debug attribute= null.
 log4j: Ignoring debug attribute.
 log4j: reset attribute= false.
 log4j: Threshold =null.
 log4j: Level value for root is  [debug].
 log4j: root level set to DEBUG
 log4j: Class name: [org.apache.log4j.ConsoleAppender]
 log4j: Parsing layout of class: org.apache.log4j.PatternLayout
 log4j: Setting property [conversionPattern] to [[%d{ISO8601} %t %c]
 %m%n].
 log4j: Adding appender named [CA] to category [root]

 -Original Message-
 From: Scott Deboy [mailto:scott.de...@gmail.com]
 Sent: Thursday, September 15, 2011 1:54 PM
 To: Log4J Users List
 Subject: Re: log4jEdit the event received

 There is a DTD for core elements but alternate elements can be added
 (like
 rewritepolicy)...you won't find rewritepolicy in the DTD.

 Can you add -Dlog4j.debug=true to your appender-side java command, and
 paste
 the output?

 Thanks

 Scott

 On Thu, Sep 15, 2011 at 10:38 AM, Konduru, Geetha
 geetha_kond...@medco.comwrote:

  Where can I find XMLschema file for log4j XML configuration file
 
 
  Thank U,
  VGSS
 
  -Original Message-
  From: Scott Deboy [mailto:scott.de...@gmail.com]
  Sent: Wednesday, September 14, 2011 4:51 PM
  To: Log4J Users List
  Subject: Re: log4jEdit the event received
 
  Missed the end param on the nested properties param...not sure about
  case of
  RewritePolicy node name..may be rewritePolicy.
 
  appender name=rewrite
  class=org.apache.log4j.rewrite.RewriteAppender
 appender name=socket
 class=org.apache.log4j.net.SocketAppender
   param name=Port value=12346/
   param name=RemoteHost value=localhost/
   param name=Application value=app1/
   param name=ReconnectionDelay value=6/
   param name=Threshold value=ALL/
 /appender
 RewritePolicy name=propertyPolicy
  class=org.apache.log4j.rewrite.PropertyRewritePolicy
 param name=properties
 
 value=somepropertyname1=somepropertyvalue1,somepropertyname2=someproper
  tyvalue2/
 /RewritePolicy
  /appender
 
 
  On Wed, Sep 14, 2011 at 1:48 PM, Konduru, Geetha
  geetha_kond...@medco.comwrote:
 
   Thank U...
  
   -Original Message-
   From: Scott Deboy [mailto:scott.de...@gmail.com]
   Sent: Wednesday, September 14, 2011 4:31 PM
   To: Log4J Users List
   Subject: Re: log4jEdit the event received
  
   remoteSourceInfo contains the connected port:
  
   hostName = socket.getInetAddress().getHostName();
   remoteInfo = hostName + : + socket.getPort();
  
   On Wed, Sep 14, 2011 at 1:23 PM, Konduru, Geetha
   geetha_kond...@medco.comwrote:
  
yes, I got them
   
how are hostname and  log4j.remoteSourceInfo  different from
  each
other
   
thank U
VGSS
   
   
-Original Message-
From: Scott Deboy [mailto:scott.de...@gmail.com]
Sent: Wednesday, September 14, 2011 4:15 PM
To: Log4J Users List
Subject: Re: log4jEdit the event received

Re: log4j----Edit the event received

2011-09-16 Thread Scott Deboy
I just tried this and it worked fineI modified the Chainsaw config file
I was using (anything received by Chainsaw can also be sent to appenders
defined in the same config)...configuration and example log file output
below:

Here's what I added to the Chainsaw config file:
   appender name=F1 class=org.apache.log4j.FileAppender
   param name=file value=c:/temp/file.txt/
   param name=append value=false/
   layout class=org.apache.log4j.PatternLayout
 param name=ConversionPattern value=%p %c - p1:%X{p1} p2:%X{p2}
%m%n/
   /layout
 /appender


 appender name=A1 class=org.apache.log4j.rewrite.RewriteAppender
   appender-ref ref=F1/
   rewritePolicy
class=org.apache.log4j.rewrite.PropertyRewritePolicy
 param name=properties value=p1=Hello,p2=World,x1=3.1415/
   /rewritePolicy
 /appender

   root
  level value=debug/
   appender-ref ref=A1 /
/root

And here is an example output line:
DEBUG Unknown - p1:Hello p2:World 20110916 09:16:16.870 NOTICE   RI- RI.DRI
 FATAL ERROR WARNING INFO


On Fri, Sep 16, 2011 at 11:01 AM, Konduru, Geetha
geetha_kond...@medco.comwrote:

 I tried this, its not working, following are warnings I get





 log4j:WARN Continuable parsing error 48 and column 80

 log4j:WARN Element type rewritePolicy must be declared.

 log4j:WARN Continuable parsing error 52 and column 14

 log4j:WARN The content of element type appender must match
 (errorHandler?,param*,rollingPolicy?,triggeringPolicy?,connectionSource
 ?,layout?,filter*,appender-ref*).





 Adding an Appender to RewriteAppender is working fine, but assigning
 rewritePolicy to a RewriteAppender is failing.





 Thank U,

 VGSS



 -Original Message-
 From: Scott Deboy [mailto:scott.de...@gmail.com]
 Sent: Friday, September 16, 2011 1:48 PM
 To: Log4J Users List
 Subject: Re: log4jEdit the event received



 Here is an example from the tests in log4j:



 http://svn.apache.org/viewvc/logging/log4j/companions/receivers/trunk/sr
 c/test/resources/org/apache/log4j/rewrite/property.xml?view=markuppathr
 ev=564831



 appender name=F1 class=org.apache.log4j.FileAppender

   param name=file value=temp/

   param name=append value=false/

   layout class=org.apache.log4j.PatternLayout

 param name=ConversionPattern value=%p %c - p1:%X{p1}
 p2:%X{p2}

 %m%n/

   /layout

 /appender





 appender name=A1
 class=org.apache.log4j.rewrite.RewriteAppender

   appender-ref ref=F1/

   rewritePolicy

 class=org.apache.log4j.rewrite.PropertyRewritePolicy

 param name=properties value=p1=Hello,p2=World,x1=3.1415/

   /rewritePolicy

 /appender



 root

   level value =debug /

   appender-ref ref=A1 /

 /root



 On Fri, Sep 16, 2011 at 8:49 AM, Konduru, Geetha

 geetha_kond...@medco.comwrote:



  Would any one please give an example of xml configuration file with

  Rewrite Appender.

 

  Thank U,

  Vgss

 

  -Original Message-

  From: Konduru, Geetha [mailto:geetha_kond...@medco.com]

  Sent: Thursday, September 15, 2011 1:57 PM

  To: Log4J Users List

  Subject: RE: log4jEdit the event received

 

  log4j: Trying to find [server2Rewritelog4j.xml] using context

  classloader sun.misc.Launcher$AppClassLoader@601bb1.

  log4j: Using URL

  [file:/C:/EclipseWorkSpace/GemfireTest/bin/server2Rewritelog4j.xml]
 for

  automatic log4j configuration.

  log4j: Preferred configurator class:

  org.apache.log4j.xml.DOMConfigurator

  log4j: System property is :null

  log4j: Standard DocumentBuilderFactory search succeded.

  log4j: DocumentBuilderFactory is:

  com.sun.org.apache.xerces.internal.jaxp.DocumentBuilderFactoryImpl

  log4j:WARN Continuable parsing error 19 and column 97

  log4j:WARN Element type rewritePolicy must be declared.

  log4j:WARN Continuable parsing error 22 and column 12

  log4j:WARN The content of element type appender must match

 
 (errorHandler?,param*,rollingPolicy?,triggeringPolicy?,connectionSource

  ?,layout?,filter*,appender-ref*).

  log4j: debug attribute= null.

  log4j: Ignoring debug attribute.

  log4j: reset attribute= false.

  log4j: Threshold =null.

  log4j: Level value for root is  [debug].

  log4j: root level set to DEBUG

  log4j: Class name: [org.apache.log4j.ConsoleAppender]

  log4j: Parsing layout of class: org.apache.log4j.PatternLayout

  log4j: Setting property [conversionPattern] to [[%d{ISO8601} %t %c]

  %m%n].

  log4j: Adding appender named [CA] to category [root]

 

  -Original Message-

  From: Scott Deboy [mailto:scott.de...@gmail.com]

  Sent: Thursday, September 15, 2011 1:54 PM

  To: Log4J Users List

  Subject: Re: log4jEdit the event received

 

  There is a DTD for core elements but alternate elements can be added

  (like

  rewritepolicy)...you won't find rewritepolicy in the DTD.

 

  Can you add -Dlog4j.debug=true to your appender-side java command, and

  paste

  the output

Re: log4j----Edit the event received

2011-09-16 Thread Scott Deboy
In theory then, you should be able to add the entire chainsaw classpath to
your application classpath and see it work..yes?

On Fri, Sep 16, 2011 at 12:58 PM, Konduru, Geetha
geetha_kond...@medco.comwrote:

 Just adding to last post , I am using log4j1.2.16 which is the one used
 by chainsaw application too...

 -Original Message-
 From: Konduru, Geetha [mailto:geetha_kond...@medco.com]
 Sent: Friday, September 16, 2011 3:26 PM
 To: Log4J Users List
 Subject: RE: log4jEdit the event received

 Even for me it is working on chainsaw side.
 But if I have this on my application side where I define SocketAppender
 , it is not working, I included components ,extras and receivers jars.


 Thank U,
 VGSS

 -Original Message-
 From: Scott Deboy [mailto:scott.de...@gmail.com]
 Sent: Friday, September 16, 2011 3:03 PM
 To: Log4J Users List
 Subject: Re: log4jEdit the event received

 I just tried this and it worked fineI modified the Chainsaw config
 file
 I was using (anything received by Chainsaw can also be sent to appenders
 defined in the same config)...configuration and example log file output
 below:

 Here's what I added to the Chainsaw config file:
   appender name=F1 class=org.apache.log4j.FileAppender
   param name=file value=c:/temp/file.txt/
   param name=append value=false/
   layout class=org.apache.log4j.PatternLayout
 param name=ConversionPattern value=%p %c - p1:%X{p1}
 p2:%X{p2}
 %m%n/
   /layout
 /appender


 appender name=A1
 class=org.apache.log4j.rewrite.RewriteAppender
   appender-ref ref=F1/
   rewritePolicy
 class=org.apache.log4j.rewrite.PropertyRewritePolicy
 param name=properties value=p1=Hello,p2=World,x1=3.1415/
   /rewritePolicy
 /appender

   root
  level value=debug/
   appender-ref ref=A1 /
/root

 And here is an example output line:
 DEBUG Unknown - p1:Hello p2:World 20110916 09:16:16.870 NOTICE   RI-
 RI.DRI
  FATAL ERROR WARNING INFO


 On Fri, Sep 16, 2011 at 11:01 AM, Konduru, Geetha
 geetha_kond...@medco.comwrote:

  I tried this, its not working, following are warnings I get
 
 
 
 
 
  log4j:WARN Continuable parsing error 48 and column 80
 
  log4j:WARN Element type rewritePolicy must be declared.
 
  log4j:WARN Continuable parsing error 52 and column 14
 
  log4j:WARN The content of element type appender must match
 
 (errorHandler?,param*,rollingPolicy?,triggeringPolicy?,connectionSource
  ?,layout?,filter*,appender-ref*).
 
 
 
 
 
  Adding an Appender to RewriteAppender is working fine, but assigning
  rewritePolicy to a RewriteAppender is failing.
 
 
 
 
 
  Thank U,
 
  VGSS
 
 
 
  -Original Message-
  From: Scott Deboy [mailto:scott.de...@gmail.com]
  Sent: Friday, September 16, 2011 1:48 PM
  To: Log4J Users List
  Subject: Re: log4jEdit the event received
 
 
 
  Here is an example from the tests in log4j:
 
 
 
 
 http://svn.apache.org/viewvc/logging/log4j/companions/receivers/trunk/sr
 
 c/test/resources/org/apache/log4j/rewrite/property.xml?view=markuppathr
  ev=564831
 
 
 
  appender name=F1 class=org.apache.log4j.FileAppender
 
param name=file value=temp/
 
param name=append value=false/
 
layout class=org.apache.log4j.PatternLayout
 
  param name=ConversionPattern value=%p %c - p1:%X{p1}
  p2:%X{p2}
 
  %m%n/
 
/layout
 
  /appender
 
 
 
 
 
  appender name=A1
  class=org.apache.log4j.rewrite.RewriteAppender
 
appender-ref ref=F1/
 
rewritePolicy
 
  class=org.apache.log4j.rewrite.PropertyRewritePolicy
 
  param name=properties value=p1=Hello,p2=World,x1=3.1415/
 
/rewritePolicy
 
  /appender
 
 
 
  root
 
level value =debug /
 
appender-ref ref=A1 /
 
  /root
 
 
 
  On Fri, Sep 16, 2011 at 8:49 AM, Konduru, Geetha
 
  geetha_kond...@medco.comwrote:
 
 
 
   Would any one please give an example of xml configuration file with
 
   Rewrite Appender.
 
  
 
   Thank U,
 
   Vgss
 
  
 
   -Original Message-
 
   From: Konduru, Geetha [mailto:geetha_kond...@medco.com]
 
   Sent: Thursday, September 15, 2011 1:57 PM
 
   To: Log4J Users List
 
   Subject: RE: log4jEdit the event received
 
  
 
   log4j: Trying to find [server2Rewritelog4j.xml] using context
 
   classloader sun.misc.Launcher$AppClassLoader@601bb1.
 
   log4j: Using URL
 
   [file:/C:/EclipseWorkSpace/GemfireTest/bin/server2Rewritelog4j.xml]
  for
 
   automatic log4j configuration.
 
   log4j: Preferred configurator class:
 
   org.apache.log4j.xml.DOMConfigurator
 
   log4j: System property is :null
 
   log4j: Standard DocumentBuilderFactory search succeded.
 
   log4j: DocumentBuilderFactory is:
 
   com.sun.org.apache.xerces.internal.jaxp.DocumentBuilderFactoryImpl
 
   log4j:WARN Continuable parsing error 19 and column 97
 
   log4j:WARN Element type rewritePolicy must be declared.
 
   log4j:WARN Continuable parsing error 22 and column 12
 
   log4j:WARN

Re: log4j----Edit the event received

2011-09-15 Thread Scott Deboy
Chainsaw includes those jars in its standalone zip.

The extras companion has been released:
http://logging.apache.org/log4j/companions/extras/download.html

The receivers and component companions have not yet been officially
released, so you would have to build them from source if you didn't use the
jars from the chainsaw zip.

http://logging.apache.org/log4j/companions/component/index.html
http://logging.apache.org/log4j/companions/receivers/index.html

Scott

On Wed, Sep 14, 2011 at 7:25 PM, Konduru, Geetha
geetha_kond...@medco.comwrote:

 Where can I download the receivers companion jar, component companion
 jar  and extra companion jar.

 Thank U,
 VGSS


 -Original Message-
 From: Scott Deboy [mailto:scott.de...@gmail.com]
 Sent: Wednesday, September 14, 2011 4:50 PM
 To: Log4J Users List
 Subject: Re: log4jEdit the event received

 There are only three unique attributes provided for socket-received
 events:
 hostname
 remoteSourceInfo
 application (if set on appender)

 If you can't leverage application and would like to use additional
 properties to identify instances, there is a mechanism that supports
 that
 (via configuration): RewriteAppender

 RewriteAppender allows you to modify event attributes (or add
 properties)
 before sending the event to the appender.

 A RewriteAppender expects a nested appender (your SocketAppender) and a
 RewritePolicy.

 You can use a PropertyRewritePolicy as a quick way to add custom
 properties
 to each event.

 This requires you to add the receivers companion jar and probably
 component
 companion jar (not sure about extras companion) to your appender side.

 http://logging.apache.org/log4j/companions/receivers/apidocs/org/apache/
 log4j/rewrite/RewriteAppender.html
 http://logging.apache.org/log4j/companions/receivers/apidocs/org/apache/
 log4j/rewrite/RewritePolicy.html

 Example configuration (didn't run this, but it should be correct) that
 will
 add two properties to each event, somepropertyname1 and
 somepropertyname2.

 appender name=rewrite
 class=org.apache.log4j.rewrite.RewriteAppender
appender name=socket class=org.apache.log4j.net.SocketAppender
  param name=Port value=12346/
  param name=RemoteHost value=localhost/
  param name=Application value=app1/
  param name=ReconnectionDelay value=6/
  param name=Threshold value=ALL/
/appender
RewritePolicy name=propertyPolicy
 class=org.apache.log4j.rewrite.PropertyRewritePolicy
param name=properties
 value=somepropertyname1=somepropertyvalue1,somepropertyname2=someproper
 tyvalue2
/RewritePolicy
 /appender

 Scott


 On Wed, Sep 14, 2011 at 1:29 PM, Konduru, Geetha
 geetha_kond...@medco.comwrote:

  Actually  issue is , We have 100 server instances running on 20
  different machines (5 instances per machine).
 
  We want to merge and see them,
 
  When I merge , seeing  log4j.remoteSourceInfo   I can say particular
  logging event is generated by server instances running on one
 particular
  machine, Is there a way to figure out which particular Instance out of
 5
  instances running on that particular machine.
 
  Thank u,
  VGSS
 
  -Original Message-
  From: Scott Deboy [mailto:scott.de...@gmail.com]
  Sent: Wednesday, September 14, 2011 4:15 PM
  To: Log4J Users List
  Subject: Re: log4jEdit the event received
 
  The SocketReceiver adds two properties to each event:
  hostname
  log4j.remoteSourceInfo
 
  With the developer snapshot of Chainsaw you should see those as
  individual
  columns in the table.  If they aren't displayed by default you can
  enable
  them via the tab preferences menu (select Columns).
 
  Scott
 
  On Wed, Sep 14, 2011 at 12:38 PM, Konduru, Geetha
  geetha_kond...@medco.comwrote:
 
   Hi,
  
  
  
What I am looking for is, every event received by SocketAppender,
  even
   before it send to remote machine, it must append  to the event(on
  which
   log4j is running).
  
  
  
Can any one please tell me a solution for this.
  
  
  
   Example: if application(running on machine HOSTNAME) logs message I
  am
   a Logging event, than SOCKET APPENDER must send following to REMOTE
   machine(or SOCKET RECEIVER on Remote machine should receive
 following
  as
   log message).
  
  
  
   HOSTNAME:I am a Logging event
  
  
  
  
  
  
  
  
  
  
  
  
  
   Thank U,
  
   VGSS
  
  
 **
   This e-mail message and any attachments contain confidential
  information
   from Medco. If you are not the intended recipient, you are hereby
  notified
   that disclosure, printing, copying, distribution, or the taking of
 any
   action in reliance on the contents of this electronic information is
   strictly prohibited. If you have received this e-mail message in
  error,
   please immediately notify the sender by reply message and then
 delete
  the
   electronic message and any attachments

Re: Chainsaw-timestap

2011-09-15 Thread Scott Deboy
Most layout and display configuration settings are tab-specific.  Check the
tab preferences dialog.

On Thu, Sep 15, 2011 at 11:30 AM, Konduru, Geetha
geetha_kond...@medco.comwrote:

 **

 After I click Application wide preferences , I only see following windows.
 

 CurrenTab is all the time dislabled.

 ** **

 ** **

 ** **

 ** **

 ** **

 ** **

 ** **

 ** **

 

 ** **

 ** **

 ** **

 ** **

 ** **

 ** **

 

 ** **

 -Original Message-
 From: Scott Deboy [mailto:scott.de...@gmail.com]
 Sent: Thursday, September 15, 2011 2:24 PM
 To: **Log4J Users List**
 Subject: Re: Chainsaw-timestap

 ** **

 There are a lot of view-related settings - see the view, application-wide*
 ***

 preferences menu option and the current tab, tab preferences menu option.*
 ***

 Under tab preferences, you can change the display of the timestamp.  You
 can

 also toggle between two formats by right-clicking on the timestamp header
 in

 the table.

 ** **

 Scott

 ** **

 On Thu, Sep 15, 2011 at 11:09 AM, Konduru, Geetha

 geetha_kond...@medco.comwrote:

 ** **

  Hi,

 ** **

 ** **

 ** **

 ** **

 ** **

   In chainsaw timestamp column is just giving  hh:mm:ss,  what should I**
 **

  do to even see the date (/mm/dd).

 ** **

 ** **

 ** **

 ** **

 ** **

 ** **

 ** **

  Thank u,

 ** **

  VGSS

 ** **

  
 **

  This e-mail message and any attachments contain confidential information
 

  from Medco. If you are not the intended recipient, you are hereby
 notified

  that disclosure, printing, copying, distribution, or the taking of any**
 **

  action in reliance on the contents of this electronic information is

  strictly prohibited. If you have received this e-mail message in error,*
 ***

  please immediately notify the sender by reply message and then delete the
 

  electronic message and any attachments.

 ** **
  --
 This e-mail message and any attachments contain confidential information
 from Medco. If you are not the intended recipient, you are hereby notified
 that disclosure, printing, copying, distribution, or the taking of any
 action in reliance on the contents of this electronic information is
 strictly prohibited. If you have received this e-mail message in error,
 please immediately notify the sender by reply message and then delete the
 electronic message and any attachments.



Re: Chainsaw-timestap

2011-09-15 Thread Scott Deboy
Right-click in the table and select tab preferences, or use the 'current
tab, tab preferences' menu item.

On Thu, Sep 15, 2011 at 11:39 AM, Konduru, Geetha
geetha_kond...@medco.comwrote:

 How to get tab preference dialog???

 Thank U,
 VGSS

 -Original Message-
 From: Scott Deboy [mailto:scott.de...@gmail.com]
 Sent: Thursday, September 15, 2011 2:35 PM
 To: Log4J Users List
 Subject: Re: Chainsaw-timestap

 Most layout and display configuration settings are tab-specific.  Check
 the
 tab preferences dialog.

 On Thu, Sep 15, 2011 at 11:30 AM, Konduru, Geetha
 geetha_kond...@medco.comwrote:

  **
 
  After I click Application wide preferences , I only see following
 windows.
  
 
  CurrenTab is all the time dislabled.
 
  ** **
 
  ** **
 
  ** **
 
  ** **
 
  ** **
 
  ** **
 
  ** **
 
  ** **
 
  
 
  ** **
 
  ** **
 
  ** **
 
  ** **
 
  ** **
 
  ** **
 
  
 
  ** **
 
  -Original Message-
  From: Scott Deboy [mailto:scott.de...@gmail.com]
  Sent: Thursday, September 15, 2011 2:24 PM
  To: **Log4J Users List**
  Subject: Re: Chainsaw-timestap
 
  ** **
 
  There are a lot of view-related settings - see the view,
 application-wide*
  ***
 
  preferences menu option and the current tab, tab preferences menu
 option.*
  ***
 
  Under tab preferences, you can change the display of the timestamp.
 You
  can
 
  also toggle between two formats by right-clicking on the timestamp
 header
  in
 
  the table.
 
  ** **
 
  Scott
 
  ** **
 
  On Thu, Sep 15, 2011 at 11:09 AM, Konduru, Geetha
 
  geetha_kond...@medco.comwrote:
 
  ** **
 
   Hi,
 
  ** **
 
  ** **
 
  ** **
 
  ** **
 
  ** **
 
In chainsaw timestamp column is just giving  hh:mm:ss,  what should
 I**
  **
 
   do to even see the date (/mm/dd).
 
  ** **
 
  ** **
 
  ** **
 
  ** **
 
  ** **
 
  ** **
 
  ** **
 
   Thank u,
 
  ** **
 
   VGSS
 
  ** **
 
  
 
  **
 
   This e-mail message and any attachments contain confidential
 information
  
 
   from Medco. If you are not the intended recipient, you are hereby
  notified
 
   that disclosure, printing, copying, distribution, or the taking of
 any**
  **
 
   action in reliance on the contents of this electronic information
 is
 
   strictly prohibited. If you have received this e-mail message in
 error,*
  ***
 
   please immediately notify the sender by reply message and then
 delete the
  
 
   electronic message and any attachments.
 
  ** **
   --
  This e-mail message and any attachments contain confidential
 information
  from Medco. If you are not the intended recipient, you are hereby
 notified
  that disclosure, printing, copying, distribution, or the taking of any
  action in reliance on the contents of this electronic information is
  strictly prohibited. If you have received this e-mail message in
 error,
  please immediately notify the sender by reply message and then delete
 the
  electronic message and any attachments.
 

 **
 This e-mail message and any attachments contain confidential information
 from Medco. If you are not the intended recipient, you are hereby notified
 that disclosure, printing, copying, distribution, or the taking of any
 action in reliance on the contents of this electronic information is
 strictly prohibited. If you have received this e-mail message in error,
 please immediately notify the sender by reply message and then delete the
 electronic message and any attachments.

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




Re: Chainsaw Events

2011-09-15 Thread Scott Deboy
Chainsaw uses a cyclic buffer by default, which means as new events are
received, old ones are removed from the table.  That cyclic buffer size is
global, but you can toggle between cyclic and non-cyclic and that is a
tab-specific persistnet setting.  Once you hit the cyclic buffer limit, more
CPU will be used to drop old events.

Chainsaw holds all events in memory, so modify the -Xmx and -Xms VM args to
support bigger files if you want cyclic buffering disabled.

Chainsaw can store events received from a file - use the file, load chainsaw
configuration menu option and then either choose to have it read your
log4j.xml/log4j.properties fileappender configuration, or use the 'process a
log file' option to build the LogFilePatternReceiver configuration yourself.


Scott

On Thu, Sep 15, 2011 at 12:24 PM, Konduru, Geetha
geetha_kond...@medco.comwrote:

 1.How many events  will it store?

 2..Using chain saw can we store all events received in a file.





 Thank U,

 Vgss

 **
 This e-mail message and any attachments contain confidential information
 from Medco. If you are not the intended recipient, you are hereby notified
 that disclosure, printing, copying, distribution, or the taking of any
 action in reliance on the contents of this electronic information is
 strictly prohibited. If you have received this e-mail message in error,
 please immediately notify the sender by reply message and then delete the
 electronic message and any attachments.



Re: Chainsaw Events

2011-09-15 Thread Scott Deboy
Yes...use the File, Save events as menu option.

The events displayed on screen (whatever is not filtered out) plus any
annotations you provide (by editing the 'marker' column) are exported as
events using log4j's XML format.

If you use a .zip extension on the file name it will zip the xml file.

Scott

On Thu, Sep 15, 2011 at 1:23 PM, Konduru, Geetha
geetha_kond...@medco.comwrote:

 Sorry , my question is.

 Can chainsaw store all evenet it is receiving from SocketReceiver in a
 file (which can be archived)

 Thank u,
 Vgss

 -Original Message-
 From: Scott Deboy [mailto:scott.de...@gmail.com]
 Sent: Thursday, September 15, 2011 3:30 PM
 To: Log4J Users List
 Subject: Re: Chainsaw Events

 Chainsaw uses a cyclic buffer by default, which means as new events are
 received, old ones are removed from the table.  That cyclic buffer size
 is
 global, but you can toggle between cyclic and non-cyclic and that is a
 tab-specific persistnet setting.  Once you hit the cyclic buffer limit,
 more
 CPU will be used to drop old events.

 Chainsaw holds all events in memory, so modify the -Xmx and -Xms VM args
 to
 support bigger files if you want cyclic buffering disabled.

 Chainsaw can store events received from a file - use the file, load
 chainsaw
 configuration menu option and then either choose to have it read your
 log4j.xml/log4j.properties fileappender configuration, or use the
 'process a
 log file' option to build the LogFilePatternReceiver configuration
 yourself.


 Scott

 On Thu, Sep 15, 2011 at 12:24 PM, Konduru, Geetha
 geetha_kond...@medco.comwrote:

  1.How many events  will it store?
 
  2..Using chain saw can we store all events received in a file.
 
 
 
 
 
  Thank U,
 
  Vgss
 
  **
  This e-mail message and any attachments contain confidential
 information
  from Medco. If you are not the intended recipient, you are hereby
 notified
  that disclosure, printing, copying, distribution, or the taking of any
  action in reliance on the contents of this electronic information is
  strictly prohibited. If you have received this e-mail message in
 error,
  please immediately notify the sender by reply message and then delete
 the
  electronic message and any attachments.
 

 **
 This e-mail message and any attachments contain confidential information
 from Medco. If you are not the intended recipient, you are hereby notified
 that disclosure, printing, copying, distribution, or the taking of any
 action in reliance on the contents of this electronic information is
 strictly prohibited. If you have received this e-mail message in error,
 please immediately notify the sender by reply message and then delete the
 electronic message and any attachments.

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




Re: Chainsaw Events

2011-09-15 Thread Scott Deboy
By the way, you can email that xml or zip file to someone else and they can
load the events into Chainsaw (including your markers) by using the File,
open log4j xml-formatted file.

Scott

On Thu, Sep 15, 2011 at 1:33 PM, Konduru, Geetha
geetha_kond...@medco.comwrote:

 Thanks !!

 -Original Message-
 From: Scott Deboy [mailto:scott.de...@gmail.com]
 Sent: Thursday, September 15, 2011 4:26 PM
 To: Log4J Users List
 Subject: Re: Chainsaw Events

 Yes...use the File, Save events as menu option.

 The events displayed on screen (whatever is not filtered out) plus any
 annotations you provide (by editing the 'marker' column) are exported as
 events using log4j's XML format.

 If you use a .zip extension on the file name it will zip the xml file.

 Scott

 On Thu, Sep 15, 2011 at 1:23 PM, Konduru, Geetha
 geetha_kond...@medco.comwrote:

  Sorry , my question is.
 
  Can chainsaw store all evenet it is receiving from SocketReceiver in a
  file (which can be archived)
 
  Thank u,
  Vgss
 
  -Original Message-
  From: Scott Deboy [mailto:scott.de...@gmail.com]
  Sent: Thursday, September 15, 2011 3:30 PM
  To: Log4J Users List
  Subject: Re: Chainsaw Events
 
  Chainsaw uses a cyclic buffer by default, which means as new events
 are
  received, old ones are removed from the table.  That cyclic buffer
 size
  is
  global, but you can toggle between cyclic and non-cyclic and that is a
  tab-specific persistnet setting.  Once you hit the cyclic buffer
 limit,
  more
  CPU will be used to drop old events.
 
  Chainsaw holds all events in memory, so modify the -Xmx and -Xms VM
 args
  to
  support bigger files if you want cyclic buffering disabled.
 
  Chainsaw can store events received from a file - use the file, load
  chainsaw
  configuration menu option and then either choose to have it read your
  log4j.xml/log4j.properties fileappender configuration, or use the
  'process a
  log file' option to build the LogFilePatternReceiver configuration
  yourself.
 
 
  Scott
 
  On Thu, Sep 15, 2011 at 12:24 PM, Konduru, Geetha
  geetha_kond...@medco.comwrote:
 
   1.How many events  will it store?
  
   2..Using chain saw can we store all events received in a file.
  
  
  
  
  
   Thank U,
  
   Vgss
  
  
 **
   This e-mail message and any attachments contain confidential
  information
   from Medco. If you are not the intended recipient, you are hereby
  notified
   that disclosure, printing, copying, distribution, or the taking of
 any
   action in reliance on the contents of this electronic information is
   strictly prohibited. If you have received this e-mail message in
  error,
   please immediately notify the sender by reply message and then
 delete
  the
   electronic message and any attachments.
  
 
  **
  This e-mail message and any attachments contain confidential
 information
  from Medco. If you are not the intended recipient, you are hereby
 notified
  that disclosure, printing, copying, distribution, or the taking of any
  action in reliance on the contents of this electronic information is
  strictly prohibited. If you have received this e-mail message in
 error,
  please immediately notify the sender by reply message and then delete
 the
  electronic message and any attachments.
 
  -
  To unsubscribe, e-mail: log4j-user-unsubscr...@logging.apache.org
  For additional commands, e-mail: log4j-user-h...@logging.apache.org
 
 

 **
 This e-mail message and any attachments contain confidential information
 from Medco. If you are not the intended recipient, you are hereby notified
 that disclosure, printing, copying, distribution, or the taking of any
 action in reliance on the contents of this electronic information is
 strictly prohibited. If you have received this e-mail message in error,
 please immediately notify the sender by reply message and then delete the
 electronic message and any attachments.

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




Re: Chain saw socket appender

2011-09-14 Thread Scott Deboy

Try application instead of Application.



On Sep 14, 2011, at 7:29 AM, Konduru, Geetha  
geetha_kond...@medco.com wrote:



Sorry, it is not working  for me...

Case1:-I used exactly following configuration,

appender name=SOCKET1 class=org.apache.log4j.net.SocketAppender
 param name=Port value=12346/
 param name=RemoteHost value=localhost/
 param name=Application value=app1/
 param name=ReconnectionDelay value=6/
 param name=Threshold value=ALL/
/appender

On chainsaw I used following configuration

plugin name=MyReceiver1  
class=org.apache.log4j.net.SocketReceiver

 param name=Port value=12346/
 param  name=Threshold value=ALL/
/plugin


In chainsaw I see a tab with name localhost- ,not localhost-app1



Case 2:-

 One instance of an application is running with following
configuration.
appender name=SOCKET1 class=org.apache.log4j.net.SocketAppender
 param name=Port value=12346/
 param name=RemoteHost value=localhost/
 param name=Application value=app1/
 param name=ReconnectionDelay value=6/
 param name=Threshold value=ALL/
/appender


Second instance of same application is running with following
configuration


appender name=SOCKET2 class=org.apache.log4j.net.SocketAppender
 param name=Port value=12346/
 param name=RemoteHost value=localhost/
 param name=Application value=app2/
 param name=ReconnectionDelay value=6/
 param name=Threshold value=ALL/
/appender


On chainsaw I used following configuration

plugin name=MyReceiver1  
class=org.apache.log4j.net.SocketReceiver

 param name=Port value=12346/
 param  name=Threshold value=ALL/
/plugin


STILL I see one tab with name localhost-  and loggingevents from two
different Process are shown in one tab.



Would you please tell me as where I am going wrong.


Thanks a lot,
VGSS




-Original Message-
From: Scott Deboy [mailto:scott.de...@gmail.com]
Sent: Wednesday, September 14, 2011 1:54 AM
To: Log4J Users List
Subject: Re: Chain saw socket appender

Since log4j 1.2.15, the socket-based appenders have an 'application'
parameter that can be set which will result in an additional  
application
property being set on each event, which will then be used by  
Chainsaw to

route events to the correct tab.

The following example will result in events being routed to a tab  
called

'localhost-app1':

appender name=SOCKET1 class=org.apache.log4j.net.SocketAppender
 param name=Port value=12346/
 param name=RemoteHost value=localhost/
 param name=Application value=app1/
 param name=ReconnectionDelay value=6/
 param name=Threshold value=ALL/
/appender

By default, events are routed to tabs by resolving the hostname and
application event properties.  The tab/name event routing expression  
is

configurable via the application-wide preferences dialog.

Scott


On Tue, Sep 13, 2011 at 6:22 AM, Konduru, Geetha
geetha_kond...@medco.comwrote:


Hi,





1. Following is how my   SocketAppender  configured.





appender name=SOCKET1 class=org.apache.log4j.net.SocketAppender

param name=Port value=12346/

param name=RemoteHost value=localhost/

param name=ReconnectionDelay value=6/

param name=Threshold value=ALL/

 /appender







2. Following is how my SocketReceiver is configured.





   plugin name=MyReceiver1
class=org.apache.log4j.net.SocketReceiver

   param name=Port value=12346 /

param name=name value=Server-1 /

 param name=Threshold value=ALL /

/plugin





  By this in chainsaw I am getting a Tabbed Pane  with
name as localhost-, but what I am looking for is a Tabbed Pane with
name localhost-AppName.



Please let me know what changes should I do to get, Tabbed Pane name

as

localhost-AppName.







Thank U,

vgss

*** 
***

This e-mail message and any attachments contain confidential

information

from Medco. If you are not the intended recipient, you are hereby

notified
that disclosure, printing, copying, distribution, or the taking of  
any

action in reliance on the contents of this electronic information is
strictly prohibited. If you have received this e-mail message in

error,

please immediately notify the sender by reply message and then delete

the

electronic message and any attachments.



**
This e-mail message and any attachments contain confidential  
information from Medco. If you are not the intended recipient, you  
are hereby notified that disclosure, printing, copying,  
distribution, or the taking of any action in reliance on the  
contents of this electronic information is strictly prohibited. If  
you have received this e-mail message in error, please immediately  
notify the sender by reply message and then delete the electronic  
message and any attachments.


-
To unsubscribe, e-mail: log4j-user-unsubscr...@logging.apache.org

Re: Chain saw socket appender

2011-09-14 Thread Scott Deboy

Can you confirm the version of log4j you are using on the appender side?



On Sep 14, 2011, at 7:48 AM, Konduru, Geetha  
geetha_kond...@medco.com wrote:


I tried using application instead of Application but still I get  
the

tab name as localhost-  only.

Thank u,
vgss

-Original Message-
From: Scott Deboy [mailto:scott.de...@gmail.com]
Sent: Wednesday, September 14, 2011 10:37 AM
To: Log4J Users List
Subject: Re: Chain saw socket appender

Try application instead of Application.



On Sep 14, 2011, at 7:29 AM, Konduru, Geetha
geetha_kond...@medco.com wrote:


Sorry, it is not working  for me...

Case1:-I used exactly following configuration,

appender name=SOCKET1 class=org.apache.log4j.net.SocketAppender
param name=Port value=12346/
param name=RemoteHost value=localhost/
param name=Application value=app1/
param name=ReconnectionDelay value=6/
param name=Threshold value=ALL/
/appender

On chainsaw I used following configuration

plugin name=MyReceiver1
class=org.apache.log4j.net.SocketReceiver
param name=Port value=12346/
param  name=Threshold value=ALL/
/plugin


In chainsaw I see a tab with name localhost- ,not localhost-app1



Case 2:-

One instance of an application is running with following
configuration.
appender name=SOCKET1 class=org.apache.log4j.net.SocketAppender
param name=Port value=12346/
param name=RemoteHost value=localhost/
param name=Application value=app1/
param name=ReconnectionDelay value=6/
param name=Threshold value=ALL/
/appender


Second instance of same application is running with following
configuration


appender name=SOCKET2 class=org.apache.log4j.net.SocketAppender
param name=Port value=12346/
param name=RemoteHost value=localhost/
param name=Application value=app2/
param name=ReconnectionDelay value=6/
param name=Threshold value=ALL/
/appender


On chainsaw I used following configuration

plugin name=MyReceiver1
class=org.apache.log4j.net.SocketReceiver
param name=Port value=12346/
param  name=Threshold value=ALL/
/plugin


STILL I see one tab with name localhost-  and loggingevents from  
two

different Process are shown in one tab.



Would you please tell me as where I am going wrong.


Thanks a lot,
VGSS




-Original Message-
From: Scott Deboy [mailto:scott.de...@gmail.com]
Sent: Wednesday, September 14, 2011 1:54 AM
To: Log4J Users List
Subject: Re: Chain saw socket appender

Since log4j 1.2.15, the socket-based appenders have an 'application'
parameter that can be set which will result in an additional
application
property being set on each event, which will then be used by
Chainsaw to
route events to the correct tab.

The following example will result in events being routed to a tab
called
'localhost-app1':

appender name=SOCKET1 class=org.apache.log4j.net.SocketAppender
param name=Port value=12346/
param name=RemoteHost value=localhost/
param name=Application value=app1/
param name=ReconnectionDelay value=6/
param name=Threshold value=ALL/
/appender

By default, events are routed to tabs by resolving the hostname and
application event properties.  The tab/name event routing expression
is
configurable via the application-wide preferences dialog.

Scott


On Tue, Sep 13, 2011 at 6:22 AM, Konduru, Geetha
geetha_kond...@medco.comwrote:


Hi,





1. Following is how my   SocketAppender  configured.





appender name=SOCKET1  
class=org.apache.log4j.net.SocketAppender


   param name=Port value=12346/

   param name=RemoteHost value=localhost/

   param name=ReconnectionDelay value=6/

   param name=Threshold value=ALL/

/appender







2. Following is how my SocketReceiver is configured.





  plugin name=MyReceiver1
class=org.apache.log4j.net.SocketReceiver

   param name=Port value=12346 /

param name=name value=Server-1 /

 param name=Threshold value=ALL /

/plugin





 By this in chainsaw I am getting a Tabbed Pane  with
name as localhost-, but what I am looking for is a Tabbed Pane  
with

name localhost-AppName.



Please let me know what changes should I do to get, Tabbed Pane name

as

localhost-AppName.







Thank U,

vgss

***
***
This e-mail message and any attachments contain confidential

information

from Medco. If you are not the intended recipient, you are hereby

notified

that disclosure, printing, copying, distribution, or the taking of
any
action in reliance on the contents of this electronic information is
strictly prohibited. If you have received this e-mail message in

error,
please immediately notify the sender by reply message and then  
delete

the

electronic message and any attachments.



*** 
***

This e-mail message and any attachments contain confidential
information from Medco. If you are not the intended recipient, you
are hereby notified that disclosure, printing, copying,
distribution, or the taking of any

Re: Chain saw socket appender

2011-09-14 Thread Scott Deboy
Which version of Chainsaw are you using?

If you aren't already using it, could you try the latest developer snapshot
(Mac DMG or tarball) available from here:

http://people.apache.org/~sdeboy


Scott

On Wed, Sep 14, 2011 at 8:13 AM, Konduru, Geetha
geetha_kond...@medco.comwrote:

 I am using Log4j.1.2.16,



 I could say that on Appender side the following tag

 param name=Application value=app1 /



 or

 param name=application value=app1 /





 Are read successfully by log4j process because when I used
 following(just for testing)

 param name=pplication value=app1 /



 I got following WARNING MESSAGE,





 log4j:WARN No such property [pplication] in
 org.apache.log4j.net.SocketAppender.



 -Original Message-
 From: Scott Deboy [mailto:scott.de...@gmail.com]
 Sent: Wednesday, September 14, 2011 11:06 AM
 To: Log4J Users List
 Subject: Re: Chain saw socket appender



 Can you confirm the version of log4j you are using on the appender side?







 On Sep 14, 2011, at 7:48 AM, Konduru, Geetha

 geetha_kond...@medco.com wrote:



  I tried using application instead of Application but still I get

  the

  tab name as localhost-  only.

 

  Thank u,

  vgss

 

  -Original Message-

  From: Scott Deboy [mailto:scott.de...@gmail.com]

  Sent: Wednesday, September 14, 2011 10:37 AM

  To: Log4J Users List

  Subject: Re: Chain saw socket appender

 

  Try application instead of Application.

 

 

 

  On Sep 14, 2011, at 7:29 AM, Konduru, Geetha

  geetha_kond...@medco.com wrote:

 

  Sorry, it is not working  for me...

 

  Case1:-I used exactly following configuration,

 

  appender name=SOCKET1 class=org.apache.log4j.net.SocketAppender

  param name=Port value=12346/

  param name=RemoteHost value=localhost/

  param name=Application value=app1/

  param name=ReconnectionDelay value=6/

  param name=Threshold value=ALL/

  /appender

 

  On chainsaw I used following configuration

 

  plugin name=MyReceiver1

  class=org.apache.log4j.net.SocketReceiver

  param name=Port value=12346/

  param  name=Threshold value=ALL/

  /plugin

 

 

  In chainsaw I see a tab with name localhost- ,not localhost-app1

 

 

 

  Case 2:-

 

  One instance of an application is running with following

  configuration.

  appender name=SOCKET1 class=org.apache.log4j.net.SocketAppender

  param name=Port value=12346/

  param name=RemoteHost value=localhost/

  param name=Application value=app1/

  param name=ReconnectionDelay value=6/

  param name=Threshold value=ALL/

  /appender

 

 

  Second instance of same application is running with following

  configuration

 

 

  appender name=SOCKET2 class=org.apache.log4j.net.SocketAppender

  param name=Port value=12346/

  param name=RemoteHost value=localhost/

  param name=Application value=app2/

  param name=ReconnectionDelay value=6/

  param name=Threshold value=ALL/

  /appender

 

 

  On chainsaw I used following configuration

 

  plugin name=MyReceiver1

  class=org.apache.log4j.net.SocketReceiver

  param name=Port value=12346/

  param  name=Threshold value=ALL/

  /plugin

 

 

  STILL I see one tab with name localhost-  and loggingevents from

  two

  different Process are shown in one tab.

 

 

 

  Would you please tell me as where I am going wrong.

 

 

  Thanks a lot,

  VGSS

 

 

 

 

  -Original Message-

  From: Scott Deboy [mailto:scott.de...@gmail.com]

  Sent: Wednesday, September 14, 2011 1:54 AM

  To: Log4J Users List

  Subject: Re: Chain saw socket appender

 

  Since log4j 1.2.15, the socket-based appenders have an 'application'

  parameter that can be set which will result in an additional

  application

  property being set on each event, which will then be used by

  Chainsaw to

  route events to the correct tab.

 

  The following example will result in events being routed to a tab

  called

  'localhost-app1':

 

  appender name=SOCKET1 class=org.apache.log4j.net.SocketAppender

  param name=Port value=12346/

  param name=RemoteHost value=localhost/

  param name=Application value=app1/

  param name=ReconnectionDelay value=6/

  param name=Threshold value=ALL/

  /appender

 

  By default, events are routed to tabs by resolving the hostname and

  application event properties.  The tab/name event routing expression

  is

  configurable via the application-wide preferences dialog.

 

  Scott

 

 

  On Tue, Sep 13, 2011 at 6:22 AM, Konduru, Geetha

  geetha_kond...@medco.comwrote:

 

  Hi,

 

 

 

 

 

  1. Following is how my   SocketAppender  configured.

 

 

 

 

 

  appender name=SOCKET1

  class=org.apache.log4j.net.SocketAppender

 

 param name=Port value=12346/

 

 param name=RemoteHost value=localhost/

 

 param name=ReconnectionDelay value=6/

 

 param name=Threshold value=ALL/

 

  /appender

 

 

 

 

 

 

 

  2. Following is how my SocketReceiver is configured

Re: log4j----Edit the event received

2011-09-14 Thread Scott Deboy
The SocketReceiver adds two properties to each event:
hostname
log4j.remoteSourceInfo

With the developer snapshot of Chainsaw you should see those as individual
columns in the table.  If they aren't displayed by default you can enable
them via the tab preferences menu (select Columns).

Scott

On Wed, Sep 14, 2011 at 12:38 PM, Konduru, Geetha
geetha_kond...@medco.comwrote:

 Hi,



  What I am looking for is, every event received by SocketAppender, even
 before it send to remote machine, it must append  to the event(on which
 log4j is running).



  Can any one please tell me a solution for this.



 Example: if application(running on machine HOSTNAME) logs message I am
 a Logging event, than SOCKET APPENDER must send following to REMOTE
 machine(or SOCKET RECEIVER on Remote machine should receive following as
 log message).



 HOSTNAME:I am a Logging event













 Thank U,

 VGSS

 **
 This e-mail message and any attachments contain confidential information
 from Medco. If you are not the intended recipient, you are hereby notified
 that disclosure, printing, copying, distribution, or the taking of any
 action in reliance on the contents of this electronic information is
 strictly prohibited. If you have received this e-mail message in error,
 please immediately notify the sender by reply message and then delete the
 electronic message and any attachments.



Re: Chain saw socket appender

2011-09-14 Thread Scott Deboy
Your attachment was stripped from the reflector..can you paste in the output
into a new message?

Thanks

On Wed, Sep 14, 2011 at 1:11 PM, Konduru, Geetha
geetha_kond...@medco.comwrote:

 **

   You have received a secure message from Medco Health Solutions

 You have received a secure email message that is encrypted.

 To open the message, open the attachment securedoc.html.

 First time users: If this is the first secure email message you have
 received, you will be prompted to register to create an account and
 establish your password. Your password will be used to open this email and
 all other secure email sent from Medco Health Solutions.

 Questions? If you have questions about this email or the registration
 process, contact the sender.

 --
 This e-mail message and any attachments contain confidential information
 from Medco. If you are not the intended recipient, you are hereby notified
 that disclosure, printing, copying, distribution, or the taking of any
 action in reliance on the contents of this electronic information is
 strictly prohibited. If you have received this e-mail message in error,
 please immediately notify the sender by reply message and then delete the
 electronic message and any attachments.


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



Re: Chain saw socket appender

2011-09-14 Thread Scott Deboy
Sorry, JAVACMD is a system property:

On windows:
set JAVACMD=java

On Linux/Mac
export JAVACMD=java

On Wed, Sep 14, 2011 at 1:25 PM, Scott Deboy scott.de...@gmail.com wrote:

 You may be seeing an uncaught exception on the Swing thread..to check that,
 open a shell and set the JAVACMD argument to:
 java

 Then run the chainsaw or chainsaw.bat script.  You will see the console
 output of the JVM and log4j.

 If you see an exception please paste it in a message.


 On Wed, Sep 14, 2011 at 1:15 PM, Scott Deboy scott.de...@gmail.comwrote:

 Your attachment was stripped from the reflector..can you paste in the
 output into a new message?

 Thanks

 On Wed, Sep 14, 2011 at 1:11 PM, Konduru, Geetha 
 geetha_kond...@medco.com wrote:

 **

   You have received a secure message from Medco Health Solutions

 You have received a secure email message that is encrypted.

 To open the message, open the attachment securedoc.html.

 First time users: If this is the first secure email message you have
 received, you will be prompted to register to create an account and
 establish your password. Your password will be used to open this email and
 all other secure email sent from Medco Health Solutions.

 Questions? If you have questions about this email or the registration
 process, contact the sender.

 --
 This e-mail message and any attachments contain confidential information
 from Medco. If you are not the intended recipient, you are hereby notified
 that disclosure, printing, copying, distribution, or the taking of any
 action in reliance on the contents of this electronic information is
 strictly prohibited. If you have received this e-mail message in error,
 please immediately notify the sender by reply message and then delete the
 electronic message and any attachments.


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






Re: log4j----Edit the event received

2011-09-14 Thread Scott Deboy
remoteSourceInfo contains the connected port:

hostName = socket.getInetAddress().getHostName();
remoteInfo = hostName + : + socket.getPort();

On Wed, Sep 14, 2011 at 1:23 PM, Konduru, Geetha
geetha_kond...@medco.comwrote:

 yes, I got them

 how are hostname and  log4j.remoteSourceInfo  different from each
 other

 thank U
 VGSS


 -Original Message-
 From: Scott Deboy [mailto:scott.de...@gmail.com]
 Sent: Wednesday, September 14, 2011 4:15 PM
 To: Log4J Users List
 Subject: Re: log4jEdit the event received

 The SocketReceiver adds two properties to each event:
 hostname
 log4j.remoteSourceInfo

 With the developer snapshot of Chainsaw you should see those as
 individual
 columns in the table.  If they aren't displayed by default you can
 enable
 them via the tab preferences menu (select Columns).

 Scott

 On Wed, Sep 14, 2011 at 12:38 PM, Konduru, Geetha
 geetha_kond...@medco.comwrote:

  Hi,
 
 
 
   What I am looking for is, every event received by SocketAppender,
 even
  before it send to remote machine, it must append  to the event(on
 which
  log4j is running).
 
 
 
   Can any one please tell me a solution for this.
 
 
 
  Example: if application(running on machine HOSTNAME) logs message I
 am
  a Logging event, than SOCKET APPENDER must send following to REMOTE
  machine(or SOCKET RECEIVER on Remote machine should receive following
 as
  log message).
 
 
 
  HOSTNAME:I am a Logging event
 
 
 
 
 
 
 
 
 
 
 
 
 
  Thank U,
 
  VGSS
 
  **
  This e-mail message and any attachments contain confidential
 information
  from Medco. If you are not the intended recipient, you are hereby
 notified
  that disclosure, printing, copying, distribution, or the taking of any
  action in reliance on the contents of this electronic information is
  strictly prohibited. If you have received this e-mail message in
 error,
  please immediately notify the sender by reply message and then delete
 the
  electronic message and any attachments.
 

 **
 This e-mail message and any attachments contain confidential information
 from Medco. If you are not the intended recipient, you are hereby notified
 that disclosure, printing, copying, distribution, or the taking of any
 action in reliance on the contents of this electronic information is
 strictly prohibited. If you have received this e-mail message in error,
 please immediately notify the sender by reply message and then delete the
 electronic message and any attachments.

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




Re: log4j----Edit the event received

2011-09-14 Thread Scott Deboy
Missed the end param on the nested properties param...not sure about case of
RewritePolicy node name..may be rewritePolicy.

appender name=rewrite class=org.apache.log4j.rewrite.RewriteAppender
appender name=socket class=org.apache.log4j.net.SocketAppender
  param name=Port value=12346/
  param name=RemoteHost value=localhost/
  param name=Application value=app1/
  param name=ReconnectionDelay value=6/
  param name=Threshold value=ALL/
/appender
RewritePolicy name=propertyPolicy
class=org.apache.log4j.rewrite.PropertyRewritePolicy
param name=properties
value=somepropertyname1=somepropertyvalue1,somepropertyname2=somepropertyvalue2/
/RewritePolicy
/appender


On Wed, Sep 14, 2011 at 1:48 PM, Konduru, Geetha
geetha_kond...@medco.comwrote:

 Thank U...

 -Original Message-
 From: Scott Deboy [mailto:scott.de...@gmail.com]
 Sent: Wednesday, September 14, 2011 4:31 PM
 To: Log4J Users List
 Subject: Re: log4jEdit the event received

 remoteSourceInfo contains the connected port:

 hostName = socket.getInetAddress().getHostName();
 remoteInfo = hostName + : + socket.getPort();

 On Wed, Sep 14, 2011 at 1:23 PM, Konduru, Geetha
 geetha_kond...@medco.comwrote:

  yes, I got them
 
  how are hostname and  log4j.remoteSourceInfo  different from each
  other
 
  thank U
  VGSS
 
 
  -Original Message-
  From: Scott Deboy [mailto:scott.de...@gmail.com]
  Sent: Wednesday, September 14, 2011 4:15 PM
  To: Log4J Users List
  Subject: Re: log4jEdit the event received
 
  The SocketReceiver adds two properties to each event:
  hostname
  log4j.remoteSourceInfo
 
  With the developer snapshot of Chainsaw you should see those as
  individual
  columns in the table.  If they aren't displayed by default you can
  enable
  them via the tab preferences menu (select Columns).
 
  Scott
 
  On Wed, Sep 14, 2011 at 12:38 PM, Konduru, Geetha
  geetha_kond...@medco.comwrote:
 
   Hi,
  
  
  
What I am looking for is, every event received by SocketAppender,
  even
   before it send to remote machine, it must append  to the event(on
  which
   log4j is running).
  
  
  
Can any one please tell me a solution for this.
  
  
  
   Example: if application(running on machine HOSTNAME) logs message I
  am
   a Logging event, than SOCKET APPENDER must send following to REMOTE
   machine(or SOCKET RECEIVER on Remote machine should receive
 following
  as
   log message).
  
  
  
   HOSTNAME:I am a Logging event
  
  
  
  
  
  
  
  
  
  
  
  
  
   Thank U,
  
   VGSS
  
  
 **
   This e-mail message and any attachments contain confidential
  information
   from Medco. If you are not the intended recipient, you are hereby
  notified
   that disclosure, printing, copying, distribution, or the taking of
 any
   action in reliance on the contents of this electronic information is
   strictly prohibited. If you have received this e-mail message in
  error,
   please immediately notify the sender by reply message and then
 delete
  the
   electronic message and any attachments.
  
 
  **
  This e-mail message and any attachments contain confidential
 information
  from Medco. If you are not the intended recipient, you are hereby
 notified
  that disclosure, printing, copying, distribution, or the taking of any
  action in reliance on the contents of this electronic information is
  strictly prohibited. If you have received this e-mail message in
 error,
  please immediately notify the sender by reply message and then delete
 the
  electronic message and any attachments.
 
  -
  To unsubscribe, e-mail: log4j-user-unsubscr...@logging.apache.org
  For additional commands, e-mail: log4j-user-h...@logging.apache.org
 
 

 **
 This e-mail message and any attachments contain confidential information
 from Medco. If you are not the intended recipient, you are hereby notified
 that disclosure, printing, copying, distribution, or the taking of any
 action in reliance on the contents of this electronic information is
 strictly prohibited. If you have received this e-mail message in error,
 please immediately notify the sender by reply message and then delete the
 electronic message and any attachments.

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




Re: Chain saw socket appender

2011-09-13 Thread Scott Deboy
Since log4j 1.2.15, the socket-based appenders have an 'application'
parameter that can be set which will result in an additional application
property being set on each event, which will then be used by Chainsaw to
route events to the correct tab.

The following example will result in events being routed to a tab called
'localhost-app1':

appender name=SOCKET1 class=org.apache.log4j.net.SocketAppender
  param name=Port value=12346/
  param name=RemoteHost value=localhost/
  param name=Application value=app1/
  param name=ReconnectionDelay value=6/
  param name=Threshold value=ALL/
/appender

By default, events are routed to tabs by resolving the hostname and
application event properties.  The tab/name event routing expression is
configurable via the application-wide preferences dialog.

Scott


On Tue, Sep 13, 2011 at 6:22 AM, Konduru, Geetha
geetha_kond...@medco.comwrote:

 Hi,





 1. Following is how my   SocketAppender  configured.





  appender name=SOCKET1 class=org.apache.log4j.net.SocketAppender

  param name=Port value=12346/

  param name=RemoteHost value=localhost/

  param name=ReconnectionDelay value=6/

  param name=Threshold value=ALL/

   /appender







 2. Following is how my SocketReceiver is configured.





 plugin name=MyReceiver1
 class=org.apache.log4j.net.SocketReceiver

 param name=Port value=12346 /

  param name=name value=Server-1 /

   param name=Threshold value=ALL /

  /plugin





By this in chainsaw I am getting a Tabbed Pane  with
 name as localhost-, but what I am looking for is a Tabbed Pane with
 name localhost-AppName.



 Please let me know what changes should I do to get, Tabbed Pane name as
 localhost-AppName.







 Thank U,

 vgss

 **
 This e-mail message and any attachments contain confidential information
 from Medco. If you are not the intended recipient, you are hereby notified
 that disclosure, printing, copying, distribution, or the taking of any
 action in reliance on the contents of this electronic information is
 strictly prohibited. If you have received this e-mail message in error,
 please immediately notify the sender by reply message and then delete the
 electronic message and any attachments.



Re: Chainsaw v2 - do not convert log timestamps to local time zone.

2011-08-18 Thread Scott Deboy
You can adjust what timezone is used to render timestamps in Chainsaw.

Go to current tab menu, tab preferences (or use the context menu available
in the tab's table), choose the formatting category and provide a value in
the 'timezone of event's field.

Scott

On Thu, Aug 18, 2011 at 2:51 AM, Fred Clausen f...@derf.nl wrote:

 Hello,

 We have server logs from remote systems in other time zones and it would be
 useful if I could get Chainsaw to use the time zone from which the log files
 came instead of my local time zone. Then I can directly compare with other
 logs on the same remote system.

 We are using the log4j XML format - is this something which is supported?

 Many thanks,

 Fred.

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




Re: VFSLogFilePatternReceiver not tailing over sftp

2011-08-17 Thread Scott Deboy
svn rev 1158546 addressed the inability to tail with SFTP..I will build a
developer snapshot soon.  By the way, there is finally a push to release the
remaining companions and the updated version of Chainsaw, so hopefully that
will be available as release soon.

Scott

On Wed, Aug 10, 2011 at 5:55 AM, Scott Deboy scott.de...@gmail.com wrote:

 I use tailing all the time with the file: support in VFS, so tailing in
 general is functioning properly, but I was able to repro your tailing issue
 when I used sftp... I'll look into it.

 Scott


 On Wed, Aug 10, 2011 at 4:18 AM, Mihail K sir.misho...@gmail.com wrote:

 Hello,
 Chainsaw is loading the remote log file but no new events are added unless
 I
 manually restart the receiver. Is the tailing feature implemented for
 VFSLogFilePatternReceiver? Here's my setup:
 - apache-chainsaw-2.1.0-SNAPSHOT from 
 people.apache.org/~sdeboy/http://people.apache.org/%7Esdeboy/

 - commons-vfs-1.1-SNAPSHOT.jar

 - receiver config:
 plugin name=TansrvReleaseLogFileReceiver
 class=org.apache.log4j.chainsaw.vfs.VFSLogFilePatternReceiver
 param name=fileURL
 value=sftp://:*@78.90.xx.xx///var/opt/tansrv/log/tansrv.log/
 param name=logFormat value=TIMESTAMP LEVEL LOGGER MESSAGE/
 param name=tailing value=true/
 param name=autoReconnect value=true/
   /plugin

 Here is VFSLogFilePatternReceiver's chainsaw log output:

 8 - 2011/08/10 13:01:57 -  - INFO -
 org.apache.log4j.chainsaw.vfs.VFSLogFilePatternReceiver - attempting to
 load
 file: sftp://username:passw...@78.90.xx.xx///var/opt/tansrv/log/tansrv.log
 -
  - Thread-5 -  - org.apache.log4j.spi.Log4JULogger - info -
 Log4JULogger.java - 0 - 105 - chainsaw - log

 38 - 2011/08/10 13:02:04 -  - DEBUG -
 org.apache.log4j.chainsaw.vfs.VFSLogFilePatternReceiver - regexp is
 (\S+-\S+-\S+ \S+:\S+:\S+,\S+)[ ]+(\S*\s*?)[ ]+(\S*\s*?)[ ]+(.*) -  -
 Thread-5 -  - org.apache.log4j.spi.Log4JULogger - debug -
 Log4JULogger.java
 - 7610 - 59 - chainsaw - log

 39 - 2011/08/10 13:02:04 - set - DEBUG -
 org.apache.log4j.chainsaw.vfs.VFSLogFilePatternReceiver -
 /var/opt/tansrv/log/tansrv.log exists -  - Thread-5 -  -
 org.apache.log4j.spi.Log4JULogger - debug - Log4JULogger.java - 0 - 59 -
 chainsaw - log

 48 - 2011/08/10 13:02:07 -  - DEBUG -
 org.apache.log4j.chainsaw.vfs.VFSLogFilePatternReceiver -
 /var/opt/tansrv/log/tansrv.log - tailing file - file size: 275775 -  -
 Thread-5 -  - org.apache.log4j.spi.Log4JULogger - debug -
 Log4JULogger.java
 - 2422 - 59 - chainsaw - log

 Thank you for your time!





Re: VFSLogFilePatternReceiver not tailing over sftp

2011-08-10 Thread Scott Deboy
I use tailing all the time with the file: support in VFS, so tailing in
general is functioning properly, but I was able to repro your tailing issue
when I used sftp... I'll look into it.

Scott

On Wed, Aug 10, 2011 at 4:18 AM, Mihail K sir.misho...@gmail.com wrote:

 Hello,
 Chainsaw is loading the remote log file but no new events are added unless
 I
 manually restart the receiver. Is the tailing feature implemented for
 VFSLogFilePatternReceiver? Here's my setup:
 - apache-chainsaw-2.1.0-SNAPSHOT from 
 people.apache.org/~sdeboy/http://people.apache.org/%7Esdeboy/

 - commons-vfs-1.1-SNAPSHOT.jar

 - receiver config:
 plugin name=TansrvReleaseLogFileReceiver
 class=org.apache.log4j.chainsaw.vfs.VFSLogFilePatternReceiver
 param name=fileURL
 value=sftp://:*@78.90.xx.xx///var/opt/tansrv/log/tansrv.log/
 param name=logFormat value=TIMESTAMP LEVEL LOGGER MESSAGE/
 param name=tailing value=true/
 param name=autoReconnect value=true/
   /plugin

 Here is VFSLogFilePatternReceiver's chainsaw log output:

 8 - 2011/08/10 13:01:57 -  - INFO -
 org.apache.log4j.chainsaw.vfs.VFSLogFilePatternReceiver - attempting to
 load
 file: sftp://username:passw...@78.90.xx.xx///var/opt/tansrv/log/tansrv.log
 -
  - Thread-5 -  - org.apache.log4j.spi.Log4JULogger - info -
 Log4JULogger.java - 0 - 105 - chainsaw - log

 38 - 2011/08/10 13:02:04 -  - DEBUG -
 org.apache.log4j.chainsaw.vfs.VFSLogFilePatternReceiver - regexp is
 (\S+-\S+-\S+ \S+:\S+:\S+,\S+)[ ]+(\S*\s*?)[ ]+(\S*\s*?)[ ]+(.*) -  -
 Thread-5 -  - org.apache.log4j.spi.Log4JULogger - debug - Log4JULogger.java
 - 7610 - 59 - chainsaw - log

 39 - 2011/08/10 13:02:04 - set - DEBUG -
 org.apache.log4j.chainsaw.vfs.VFSLogFilePatternReceiver -
 /var/opt/tansrv/log/tansrv.log exists -  - Thread-5 -  -
 org.apache.log4j.spi.Log4JULogger - debug - Log4JULogger.java - 0 - 59 -
 chainsaw - log

 48 - 2011/08/10 13:02:07 -  - DEBUG -
 org.apache.log4j.chainsaw.vfs.VFSLogFilePatternReceiver -
 /var/opt/tansrv/log/tansrv.log - tailing file - file size: 275775 -  -
 Thread-5 -  - org.apache.log4j.spi.Log4JULogger - debug - Log4JULogger.java
 - 2422 - 59 - chainsaw - log

 Thank you for your time!



Re: Chainsaw question

2011-08-10 Thread Scott Deboy
The code that parses XML formatted events expects event nodes only. No  
eventset.


I added support for eventset-wrapped events but it also requires the  
XML declaration to be present.


Scott


On Aug 10, 2011, at 7:32 AM, cscsaba cscsaba...@gmail.com wrote:


Hello,

I hope I dont disturb this mailing list but webpage of Apache Chainsaw
directed me here (http://logging.apache.org/chainsaw/mail-lists.html)

So, I would like to generate log4j xml by log4php for Chainsaw, but  
Chainsaw

drops some error during the processing the log file.
*The errors are :
   Parsing error on line 19 and column 32*
*XML document structures must start and end within the same  
entity.*


Check this overview : http://pastebin.com/bX3A2Dmm

My question is, what cause the parser error ? And xml starts and  
ends with
the same entity log4j:eventSet ... /log4j:eventSet then what is  
the real

problem ?

Can you point at what could be wrong ?

Thanks in advance.

Csaba


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



Re: Chainsaw question

2011-08-10 Thread Scott Deboy

No you can't unless you remove the eventset node.

You can process a regular non-XML text log file by configuring  
chainsaw with a logfilepatternreceiver. Use MESSAGE as the logformat  
to quickly get the log file in chainsaw.




On Aug 10, 2011, at 8:27 AM, cscsaba cscsaba...@gmail.com wrote:


Hello Scott,

Perhaps my weak english I could not understand what you mean by this  
below:
I added support for eventset-wrapped events but it also  
requires the

XML declaration to be present.
You have already added support, so why it cannot be handled ? What  
do you

mean by XML declaration to be present.

Briefly, I can use Apache Chainsaw to process this kind of log or  
not ?


Thanks in advance.


On Wed, Aug 10, 2011 at 4:15 PM, Scott Deboy scott.de...@gmail.com  
wrote:


The code that parses XML formatted events expects event nodes only.  
No

eventset.

I added support for eventset-wrapped events but it also requires  
the XML

declaration to be present.

Scott



On Aug 10, 2011, at 7:32 AM, cscsaba cscsaba...@gmail.com wrote:

Hello,


I hope I dont disturb this mailing list but webpage of Apache  
Chainsaw
directed me here (http://logging.apache.org/**chainsaw/mail-lists.html 
http://logging.apache.org/chainsaw/mail-lists.html

)

So, I would like to generate log4j xml by log4php for Chainsaw, but
Chainsaw
drops some error during the processing the log file.
*The errors are :
 Parsing error on line 19 and column 32*
*XML document structures must start and end within the same
entity.*

Check this overview : http://pastebin.com/bX3A2Dmm

My question is, what cause the parser error ? And xml starts and  
ends with
the same entity log4j:eventSet ... /log4j:eventSet then what  
is the

real
problem ?

Can you point at what could be wrong ?

Thanks in advance.

Csaba



--**-- 
**-
To unsubscribe, e-mail: log4j-user-unsubscribe@**logging.apache.orglog4j-user-unsubscr...@logging.apache.org 

For additional commands, e-mail: log4j-user- 
help@logging.**apache.orglog4j-user-h...@logging.apache.org





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



Re: Help Log4j Chainsaw - VFSLogFilePatternReceiver Usage

2011-07-25 Thread Scott Deboy
You can only specify one format, but you can get the non-matching rows to
still be included in the table in Chainsaw by setting AppendNonMatches to
'true' in the configuration file.  The non-matching rows will be added to
the 'unknown' logger, with the entire line set as the message.

Scott

On Mon, Jul 25, 2011 at 8:27 AM, Ding, Qin qin.d...@jpmchase.com wrote:

 Thank you Scott.  It works for the local log file.  Everything is displayed
 under Message column.  I guess I need to try the different format to see how
 to parse the log file correctly. One reason it does not parse correctly is
 that the log entries are not always consistent. Once in a while there is a
 plain text entry shown up.

 I will try sftp again soon.

 Once again, thank you.

 QD

 -Original Message-
 From: Scott Deboy [mailto:scott.de...@gmail.com]
 Sent: Thursday, July 21, 2011 5:04 PM
 To: Log4J Users List
 Subject: Re: Help Log4j Chainsaw - VFSLogFilePatternReceiver Usage

 Here you go..

 1. start chainsaw
 2. Choose the file, load chainsaw configuration menu item
 3. When the dialog opens, choose the 'process a log file' option
 4. Click the 'open file' button and choose the local file you'd like to
 process, or manually enter the sftp:// URL you want to use (I'd first try
 with a local file just to make sure it works, but once it is working, you
 can just change this to your sftp URL).
 5. Leave Log file format type as 'LogFilePatternReceiver LogFormat'
 6. Click the down arrow next to the Log file format drop down and choose
 'MESSAGE' (it will put the entire log line in the 'message' field but you
 won't have issues with mismatched log entries, so we will see events come
 in
 to a tab).
 7.don't worry about Log file timestamp format, since you don't have
 TIMESTAMP field defined in your log format
 8. Click 'save configuration as' and browse to where you want to save it
 and
 give it a name (I just entered 'c:\new-logfile-receiver-config.xml' in the
 box)
 9. Click the 'always start chainsaw with this configuration button'
 10. Press ok

 Events should show up in a new tab, the tab name being the name of the log
 file you chose to process.

 If you open the receiver panel you should see a receiver whose name is the
 log file you chose to process.

 Here is the contents of 'new-logfile-receiver-config.xml' after I did this
 (it did create a tab for me, and I have a receiver defined)

 ?xml version=1.0 encoding=UTF-8?
 log4j:configuration xmlns:log4j=http://jakarta.apache.org/log4j/;
 debug=true
plugin class=org.apache.log4j.chainsaw.vfs.VFSLogFilePatternReceiver
 name=/C:/andyRILog.txt
param name=appendNonMatches value=true/
param name=autoReconnect value=true/
param name=fileURL value=file:/C:/andyRILog.txt/
param name=logFormat value=MESSAGE/
param name=name value=/C:/andyRILog.txt/
param name=promptForUserInfo value=false/
param name=tailing value=true/
param name=timestampFormat value=-MM-dd HH:mm:ss,SSS/
param name=waitMillis value=2000/
/plugin
 /log4j:configuration

 Again, if you are going to try sftp after this, change promptForUserInfo to
 true and change your fileURL.  You can play with the logFormat and
 timestampFormat once you have it working as well.

 This worked for me out of the box with the developer snapshot you
 downloaded
 from http://people.apache.org/~sdeboy

 Scott

 On Thu, Jul 21, 2011 at 2:51 PM, Ding, Qin qin.d...@jpmchase.com wrote:

  Scott:
 
  1. I manually downloaded mylog.log; and define a logfilePatternReceiver
  within chainsaw. Pointing to mylog.log. after that, it just sits there, I
  see nothing.  The last entry in the detail panel: setValueAt, 2, 1,
  value=file:///C:\MyDocs\logs\mylog.log, valueClassclass java.lang.String
 
  2. I copied the provided configuration file and modified the
  VFSLogFilePatternReceiver and put it in a folder.  Use the instruction
 you
  gave me to load it.  But on the receiver panel I did not see anything.
   Manually define a VFSLogFilePatternReceiver.  Don't see the GUI prompt
 for
  id/pwd.
 
  Would you please give me a detailed the instruction or your working
 sample
  configuration file?
 
  Thank you
 
  QD
 
  -Original Message-
  From: Scott Deboy [mailto:scott.de...@gmail.com]
  Sent: Thursday, July 21, 2011 1:36 PM
  To: Log4J Users List
  Subject: Re: Help Log4j Chainsaw - VFSLogFilePatternReceiver Usage
 
  Chainsaw settings are stored in $userhome/.chainsaw - in that folder has
 a
  chainsaw-settings.xml file that is used to store application-wide
  preferences.  Here is how you can get the 'configurationURL' field to be
  set
  in that file via the GUI:
 
  Use the file-load Chainsaw configuration menu option, then select 'use a
  chainsaw config file' and browse to it, then check the 'always start
  chainsaw with this configuration' check box.
 
  Scott
 
 
  On Thu, Jul 21, 2011 at 11:29 AM, Ding, Qin qin.d...@jpmchase.com
 wrote:
 
   Scott

Re: Help Log4j Chainsaw - VFSLogFilePatternReceiver Usage

2011-07-22 Thread Scott Deboy
Chainsaw can automatically build a Chainsaw config file from fileappender
entries in a log4j appender config file (both log4j.xml and log4j.properties
formats)...

By the way, I assume you can get sftp processing to work fine now as well,
since it looks like you just had incorrect slashes in your URL?

The code that parses the log4j.xml config is a little case sensitive, so
modify your appender to have the 'file' param lowercase and save it - I'll
commit a fix for this.  Chainsaw doesn't know what catalina base is, so you
should temporarily replace the catalina.base system property with a path:
param name=file value=/path/to/logs/mylog.log /

Then in Chainsaw:
1. use the file-load chainsaw configuration menu item
2. Choose the (default) Use fileappender entries from a log4j config file
3. Click 'open file' and browse to your log4j xml configuration file and
select it
4. Click the 'save configuration as' button and save this configuration with
a file name (it will generate an xml configuration file, so save with an
.xml extension)
5. Click the 'always start Chainsaw with this configuration' (if you'd like)

Chainsaw should parse the conversion pattern and create a
VFSLogFilePatternReceiver configuration that will parse the fields in your
log file.

Don't forget to un-do your temporary changes to your log4j xml config file.
This same process would work for remote config files, you would just need to
change the resulting fileURL in the chainsaw config file to be an sftp://
URL.

Hope that helps..

Scott


On Fri, Jul 22, 2011 at 8:29 AM, Ding, Qin qin.d...@jpmchase.com wrote:

 Thank you Jake.

 Now with my file in C:/MyDocs/logs/mylog.log is loaded, it displays
 everything in Message column without splitting into different columns.

 On log4j event generating side, I have

 appender name=DRFA class=org.apache.log4j.DailyRollingFileAppender
 param name=File value=${catalina.base}/logs/mylog.log /
 param name=Append value=true /
 layout class=org.apache.log4j.PatternLayout
 param name=ConversionPattern
value=[%d{ISO8601}] %-5p %t (%F:%M:%L)  -%m%n  /
 /layout
 /appender

 On log4j receiving side: my receiver's logFormat is [TIMESTAMP] LEVEL
 THREAD (FILE:METHOD:LINE)  -MESSAGE

 I don't know what the filterExpression and customerLevelDefinitions are; so
 I keep them empty.

 How can I make the chainsaw parse mylog.log correctly into different
 columns?

 QD


 -Original Message-
 From: Jacob Kjome [mailto:h...@visi.com]
 Sent: Friday, July 22, 2011 9:00 AM
 To: Log4J Users List
 Subject: Re: Help Log4j Chainsaw - VFSLogFilePatternReceiver Usage


 The file isn't going to be loaded, nor written to, using an invalid URL
 with
 backslashes in it.  Use all forward slashes.  You have...

 file:///C:\MyDocs\logs\mylog.log

 It should be

 file:///C:/MyDocs/logs/mylog.log

 Or, simply...

 file:/C:/MyDocs/logs/mylog.log


 Jake

 On Thu, 21 Jul 2011 17:51:26 -0400
  Ding, Qin qin.d...@jpmchase.com wrote:
  Scott:
 
  1. I manually downloaded mylog.log; and define a logfilePatternReceiver
 within chainsaw. Pointing to mylog.log. after that, it just sits there, I
 see
 nothing.  The last entry in the detail panel: setValueAt, 2, 1,
 value=file:///C:\MyDocs\logs\mylog.log, valueClassclass java.lang.String
 
  2. I copied the provided configuration file and modified the
 VFSLogFilePatternReceiver and put it in a folder.  Use the instruction you
 gave me to load it.  But on the receiver panel I did not see anything.
  Manually define a VFSLogFilePatternReceiver.  Don't see the GUI prompt
 for
 id/pwd.
 
  Would you please give me a detailed the instruction or your working
 sample
 configuration file?
 
  Thank you
 
  QD
 
  -Original Message-
 From: Scott Deboy [mailto:scott.de...@gmail.com]
  Sent: Thursday, July 21, 2011 1:36 PM
  To: Log4J Users List
  Subject: Re: Help Log4j Chainsaw - VFSLogFilePatternReceiver Usage
 
  Chainsaw settings are stored in $userhome/.chainsaw - in that folder has
 a
  chainsaw-settings.xml file that is used to store application-wide
  preferences.  Here is how you can get the 'configurationURL' field to be
 set
  in that file via the GUI:
 
  Use the file-load Chainsaw configuration menu option, then select 'use a
  chainsaw config file' and browse to it, then check the 'always start
  chainsaw with this configuration' check box.
 
  Scott
 
 
  On Thu, Jul 21, 2011 at 11:29 AM, Ding, Qin qin.d...@jpmchase.com
 wrote:
 
  Scott, I already tried by removing the id/pwd and then set true to the
  promptforuserinfo. However, I don't see the GUI. After restarting the
 app, I
  still don't see the GUI. I think this issue might be related to the
  following problem:
 
  How does the app pick up receiver config file in my case log4j.xml?
   Yesterday, I have a log4j.xml file defined and placed it in the
 chainsaw
  folder.  Today, after I download the new chainsaw and started the app, I
  didn't tell the app where to look

Re: Help Log4j Chainsaw - VFSLogFilePatternReceiver Usage

2011-07-21 Thread Scott Deboy
Here is a configuration I just used to retrieve a log file from my Mac using
the latest developer snapshot of Chainsaw V2 running on Vista.  I don't have
a known hosts file (or .ssh folder) on my vista box in my home folder or
under cygwin home.

Modify this configuration and let me know if it works for you.

The two differences I notice here:
1. I was using an IP address and not a name that needed to be resolved
2. I only have a single slash after the IP address

Change logFormat, timestampFormat and the specifics of fileURL as needed of
course:

?xml version=1.0 encoding=UTF-8?
log4j:configuration xmlns:log4j=http://jakarta.apache.org/log4j/;
debug=true
plugin class=org.apache.log4j.chainsaw.vfs.VFSLogFilePatternReceiver
name=sftp
param name=appendNonMatches value=true/
param name=autoReconnect value=true/
param name=fileURL value=sftp://
username:userpass@192.168.1.144/pathhere/log.txt/
param name=logFormat value=TIMESTAMP PROP(OUTERLEVEL)
PROP(OUTERLOGGER)- * [THREAD] LEVEL LOGGER - MESSAGE/
param name=name value=sftp/
param name=promptForUserInfo value=false/
param name=tailing value=true/
param name=timestampFormat value=MMdd HH:mm:ss.SSS/
param name=waitMillis value=2000/
/plugin
/log4j:configuration


Scott

On Thu, Jul 21, 2011 at 6:51 AM, Ding, Qin qin.d...@jpmchase.com wrote:

 Scott,

 I downloaded new chainsaw and run it.  Still I could not get the log file.
  Here is the exception trace:

 Level
 INFO
 Logger
 org.apache.log4j.chainsaw.vfs.VFSLogFilePatternReceiver
 Time
 2011-07-21 08:43:16,361 (ms delta: 328)
 Thread
 Thread-3
 Message
 sftp://username:passw...@xxx.yyy.net/complete/path/to/logs/MyLog.log not
 available - may be due to incorrect credentials, but will re-attempt to load
 after waiting 1 millis
 Marker

 Throwable
 org.apache.commons.vfs.FileSystemException: Could not connect to SFTP
 server at sftp://myId:my...@xxx.yyy.net/;.
at
 org.apache.commons.vfs.provider.sftp.SftpFileProvider.doCreateFileSystem(SftpFileProvider.java:99)
at
 org.apache.commons.vfs.provider.AbstractOriginatingFileProvider.findFile(AbstractOriginatingFileProvider.java:81)
at
 org.apache.commons.vfs.provider.AbstractOriginatingFileProvider.findFile(AbstractOriginatingFileProvider.java:62)
at
 org.apache.commons.vfs.impl.DefaultFileSystemManager.resolveFile(DefaultFileSystemManager.java:641)
at
 org.apache.commons.vfs.impl.DefaultFileSystemManager.resolveFile(DefaultFileSystemManager.java:582)
at
 org.apache.log4j.chainsaw.vfs.VFSLogFilePatternReceiver$VFSReader.run(VFSLogFilePatternReceiver.java:358)
at java.lang.Thread.run(Unknown Source)
 Caused by: org.apache.commons.vfs.FileSystemException: Could not connect to
 SFTP server at xxx.yyy.net.
at
 org.apache.commons.vfs.provider.sftp.SftpClientFactory.createConnection(SftpClientFactory.java:214)
at
 org.apache.commons.vfs.provider.sftp.SftpFileProvider.doCreateFileSystem(SftpFileProvider.java:90)
... 6 more
 Caused by: com.jcraft.jsch.JSchException: Auth cancel
at com.jcraft.jsch.Session.connect(Session.java:451)
at com.jcraft.jsch.Session.connect(Session.java:150)
at
 org.apache.commons.vfs.provider.sftp.SftpClientFactory.createConnection(SftpClientFactory.java:210)
... 7 more

 I use both Putty and FileZilla to get MyLog.log.  Credential is good.

 Thank you for helping me.

 QD

 -Original Message-
 From: Scott Deboy [mailto:scott.de...@gmail.com]
 Sent: Wednesday, July 20, 2011 3:10 PM
 To: Log4J Users List
 Subject: Re: Help Log4j Chainsaw - VFSLogFilePatternReceiver Usage

 Are you using the latest developer snapshot of Chainsaw, available here?

 http://people.apache.org/~sdeboy

 If not, please try it and follow-up with your results.

 Thanks

 Scott

 On Wed, Jul 20, 2011 at 12:18 PM, Ding, Qin qin.d...@jpmchase.com wrote:

  I am trying to view the log4j log using
  VFSLogFilePatternReceiverNoUserInfoPrompt.
 
  Here is my log4j.xml:
 
 
 
  plugin name=VFSLogFilePatternReceiverNoUserInfoPrompt
  class=org.apache.log4j.chainsaw.vfs.VFSLogFilePatternReceiver
 
  param name=fileURL value=sftp://
  myid:my...@serverhost.xxx.yy.net//complete/path/to/logs/mylog.log/
 
  param name=timestampFormat value=-MM-dd HH:mm:ss,SSS/
 
  param name=logFormat value=[TIMESTAMP] LEVEL THREAD
  (FILE:METHOD:LINE) -MESSAGE/
 
  param name=name value=VFSLogFilePatternReceiver/
 
  param name=tailing value=true/
 
/plugin
 
 
 
  Start the chainsaw with this log4j.xml. Get the following msg:
 
 
 
  attempting to load file: sftp://
  myid:my...@serverhost.xxx.yy.net//complete/path/to/logs/mylog.log
 
  file not available - will try again in 10 seconds
 
 
 
  The file is there at the remote site, I can sftp to it.  Why can chainsaw
  find it?
 
  I tried the following with or without port number:
 
 
 
  param name=fileURL value=sftp

Re: Help Log4j Chainsaw - VFSLogFilePatternReceiver Usage

2011-07-21 Thread Scott Deboy
If you are still having problems, the issue may be with your server.
VFSLogFilePatternReceiver uses Jakarta Commons VFS, which uses the JSch
library to support the 'sftp' protocol.  According to their website, this
is:
*SSH File Transfer Protocol(version 0, 1, 2, 3)

*I'd suggest verifying your server actually supports SFTP.  It may support
ssh connections but not support the SSH File Transfer Protocol.

Scott

On Thu, Jul 21, 2011 at 9:13 AM, Scott Deboy scott.de...@gmail.com wrote:

 Here is a configuration I just used to retrieve a log file from my Mac
 using the latest developer snapshot of Chainsaw V2 running on Vista.  I
 don't have a known hosts file (or .ssh folder) on my vista box in my home
 folder or under cygwin home.

 Modify this configuration and let me know if it works for you.

 The two differences I notice here:
 1. I was using an IP address and not a name that needed to be resolved
 2. I only have a single slash after the IP address

 Change logFormat, timestampFormat and the specifics of fileURL as needed of
 course:

 ?xml version=1.0 encoding=UTF-8?
 log4j:configuration xmlns:log4j=http://jakarta.apache.org/log4j/;
 debug=true
 plugin class=org.apache.log4j.chainsaw.vfs.VFSLogFilePatternReceiver
 name=sftp
 param name=appendNonMatches value=true/
 param name=autoReconnect value=true/
 param name=fileURL value=sftp://
 username:userpass@192.168.1.144/pathhere/log.txt/
 param name=logFormat value=TIMESTAMP PROP(OUTERLEVEL)
 PROP(OUTERLOGGER)- * [THREAD] LEVEL LOGGER - MESSAGE/
 param name=name value=sftp/
 param name=promptForUserInfo value=false/

 param name=tailing value=true/
 param name=timestampFormat value=MMdd HH:mm:ss.SSS/
 param name=waitMillis value=2000/
 /plugin
 /log4j:configuration


 Scott


 On Thu, Jul 21, 2011 at 6:51 AM, Ding, Qin qin.d...@jpmchase.com wrote:

 Scott,

 I downloaded new chainsaw and run it.  Still I could not get the log file.
  Here is the exception trace:

 Level
 INFO
 Logger
 org.apache.log4j.chainsaw.vfs.VFSLogFilePatternReceiver
 Time
 2011-07-21 08:43:16,361 (ms delta: 328)
 Thread
 Thread-3
 Message
 sftp://username:passw...@xxx.yyy.net/complete/path/to/logs/MyLog.log not
 available - may be due to incorrect credentials, but will re-attempt to load
 after waiting 1 millis
 Marker

 Throwable
 org.apache.commons.vfs.FileSystemException: Could not connect to SFTP
 server at sftp://myId:my...@xxx.yyy.net/;.
at
 org.apache.commons.vfs.provider.sftp.SftpFileProvider.doCreateFileSystem(SftpFileProvider.java:99)
at
 org.apache.commons.vfs.provider.AbstractOriginatingFileProvider.findFile(AbstractOriginatingFileProvider.java:81)
at
 org.apache.commons.vfs.provider.AbstractOriginatingFileProvider.findFile(AbstractOriginatingFileProvider.java:62)
at
 org.apache.commons.vfs.impl.DefaultFileSystemManager.resolveFile(DefaultFileSystemManager.java:641)
at
 org.apache.commons.vfs.impl.DefaultFileSystemManager.resolveFile(DefaultFileSystemManager.java:582)
at
 org.apache.log4j.chainsaw.vfs.VFSLogFilePatternReceiver$VFSReader.run(VFSLogFilePatternReceiver.java:358)
at java.lang.Thread.run(Unknown Source)
 Caused by: org.apache.commons.vfs.FileSystemException: Could not connect
 to SFTP server at xxx.yyy.net.
at
 org.apache.commons.vfs.provider.sftp.SftpClientFactory.createConnection(SftpClientFactory.java:214)
at
 org.apache.commons.vfs.provider.sftp.SftpFileProvider.doCreateFileSystem(SftpFileProvider.java:90)
... 6 more
 Caused by: com.jcraft.jsch.JSchException: Auth cancel
at com.jcraft.jsch.Session.connect(Session.java:451)
at com.jcraft.jsch.Session.connect(Session.java:150)
at
 org.apache.commons.vfs.provider.sftp.SftpClientFactory.createConnection(SftpClientFactory.java:210)
... 7 more

 I use both Putty and FileZilla to get MyLog.log.  Credential is good.

 Thank you for helping me.

 QD

 -Original Message-
 From: Scott Deboy [mailto:scott.de...@gmail.com]
 Sent: Wednesday, July 20, 2011 3:10 PM
 To: Log4J Users List
 Subject: Re: Help Log4j Chainsaw - VFSLogFilePatternReceiver Usage

 Are you using the latest developer snapshot of Chainsaw, available here?

 http://people.apache.org/~sdeboy

 If not, please try it and follow-up with your results.

 Thanks

 Scott

 On Wed, Jul 20, 2011 at 12:18 PM, Ding, Qin qin.d...@jpmchase.com
 wrote:

  I am trying to view the log4j log using
  VFSLogFilePatternReceiverNoUserInfoPrompt.
 
  Here is my log4j.xml:
 
 
 
  plugin name=VFSLogFilePatternReceiverNoUserInfoPrompt
  class=org.apache.log4j.chainsaw.vfs.VFSLogFilePatternReceiver
 
  param name=fileURL value=sftp://
  myid:my...@serverhost.xxx.yy.net//complete/path/to/logs/mylog.log/
 
  param name=timestampFormat value=-MM-dd HH:mm:ss,SSS/
 
  param name=logFormat value=[TIMESTAMP] LEVEL THREAD
  (FILE:METHOD:LINE) -MESSAGE

Re: Help Log4j Chainsaw - VFSLogFilePatternReceiver Usage

2011-07-21 Thread Scott Deboy
Try this: set promptforuserinfo to 'true' and take your username and
password out of the sftp URL.  You will get a GUI username/password
prompt..maybe something with special characters in your password?

?xml version=1.0 encoding=UTF-8?
log4j:configuration xmlns:log4j=http://jakarta.apache.org/log4j/;
debug=true
plugin class=org.apache.log4j.
chainsaw.vfs.VFSLogFilePatternReceiver name=sftp
param name=appendNonMatches value=true/
param name=autoReconnect value=true/
param name=fileURL
value=sftp://192.168.1.144/pathhere/log.txthttp://username:userpass@192.168.1.144/pathhere/log.txt
/
param name=logFormat value=TIMESTAMP PROP(OUTERLEVEL)
PROP(OUTERLOGGER)- * [THREAD] LEVEL LOGGER - MESSAGE/
param name=name value=sftp/
param name=promptForUserInfo value=true/

param name=tailing value=true/
param name=timestampFormat value=MMdd HH:mm:ss.SSS/
param name=waitMillis value=2000/
/plugin
/log4j:configuration

Scott


On Thu, Jul 21, 2011 at 10:58 AM, Ding, Qin qin.d...@jpmchase.com wrote:

 Thank you, Scott.  but I get use FileZilla sftp SSH File Transfer Protocol
 to get file.  Use I guess I have to view the static file manually
 downloaded.

 Thank you very much.

 QD


 -Original Message-
 From: Scott Deboy [mailto:scott.de...@gmail.com]
 Sent: Thursday, July 21, 2011 11:36 AM
 To: Log4J Users List
 Subject: Re: Help Log4j Chainsaw - VFSLogFilePatternReceiver Usage

 If you are still having problems, the issue may be with your server.
 VFSLogFilePatternReceiver uses Jakarta Commons VFS, which uses the JSch
 library to support the 'sftp' protocol.  According to their website, this
 is:
 *SSH File Transfer Protocol(version 0, 1, 2, 3)

 *I'd suggest verifying your server actually supports SFTP.  It may support
 ssh connections but not support the SSH File Transfer Protocol.

 Scott

 On Thu, Jul 21, 2011 at 9:13 AM, Scott Deboy scott.de...@gmail.com
 wrote:

  Here is a configuration I just used to retrieve a log file from my Mac
  using the latest developer snapshot of Chainsaw V2 running on Vista.  I
  don't have a known hosts file (or .ssh folder) on my vista box in my home
  folder or under cygwin home.
 
  Modify this configuration and let me know if it works for you.
 
  The two differences I notice here:
  1. I was using an IP address and not a name that needed to be resolved
  2. I only have a single slash after the IP address
 
  Change logFormat, timestampFormat and the specifics of fileURL as needed
 of
  course:
 
  ?xml version=1.0 encoding=UTF-8?
  log4j:configuration xmlns:log4j=http://jakarta.apache.org/log4j/;
  debug=true
  plugin
 class=org.apache.log4j.chainsaw.vfs.VFSLogFilePatternReceiver
  name=sftp
  param name=appendNonMatches value=true/
  param name=autoReconnect value=true/
  param name=fileURL value=sftp://
  username:userpass@192.168.1.144/pathhere/log.txt/
  param name=logFormat value=TIMESTAMP PROP(OUTERLEVEL)
  PROP(OUTERLOGGER)- * [THREAD] LEVEL LOGGER - MESSAGE/
  param name=name value=sftp/
  param name=promptForUserInfo value=false/
 
  param name=tailing value=true/
  param name=timestampFormat value=MMdd HH:mm:ss.SSS/
  param name=waitMillis value=2000/
  /plugin
  /log4j:configuration
 
 
  Scott
 
 
  On Thu, Jul 21, 2011 at 6:51 AM, Ding, Qin qin.d...@jpmchase.com
 wrote:
 
  Scott,
 
  I downloaded new chainsaw and run it.  Still I could not get the log
 file.
   Here is the exception trace:
 
  Level
  INFO
  Logger
  org.apache.log4j.chainsaw.vfs.VFSLogFilePatternReceiver
  Time
  2011-07-21 08:43:16,361 (ms delta: 328)
  Thread
  Thread-3
  Message
  sftp://username:passw...@xxx.yyy.net/complete/path/to/logs/MyLog.lognot
  available - may be due to incorrect credentials, but will re-attempt to
 load
  after waiting 1 millis
  Marker
 
  Throwable
  org.apache.commons.vfs.FileSystemException: Could not connect to SFTP
  server at sftp://myId:my...@xxx.yyy.net/;.
 at
 
 org.apache.commons.vfs.provider.sftp.SftpFileProvider.doCreateFileSystem(SftpFileProvider.java:99)
 at
 
 org.apache.commons.vfs.provider.AbstractOriginatingFileProvider.findFile(AbstractOriginatingFileProvider.java:81)
 at
 
 org.apache.commons.vfs.provider.AbstractOriginatingFileProvider.findFile(AbstractOriginatingFileProvider.java:62)
 at
 
 org.apache.commons.vfs.impl.DefaultFileSystemManager.resolveFile(DefaultFileSystemManager.java:641)
 at
 
 org.apache.commons.vfs.impl.DefaultFileSystemManager.resolveFile(DefaultFileSystemManager.java:582)
 at
 
 org.apache.log4j.chainsaw.vfs.VFSLogFilePatternReceiver$VFSReader.run(VFSLogFilePatternReceiver.java:358)
 at java.lang.Thread.run(Unknown Source)
  Caused by: org.apache.commons.vfs.FileSystemException: Could not connect
  to SFTP server at xxx.yyy.net

Re: Help Log4j Chainsaw - VFSLogFilePatternReceiver Usage

2011-07-21 Thread Scott Deboy
Here you go..

1. start chainsaw
2. Choose the file, load chainsaw configuration menu item
3. When the dialog opens, choose the 'process a log file' option
4. Click the 'open file' button and choose the local file you'd like to
process, or manually enter the sftp:// URL you want to use (I'd first try
with a local file just to make sure it works, but once it is working, you
can just change this to your sftp URL).
5. Leave Log file format type as 'LogFilePatternReceiver LogFormat'
6. Click the down arrow next to the Log file format drop down and choose
'MESSAGE' (it will put the entire log line in the 'message' field but you
won't have issues with mismatched log entries, so we will see events come in
to a tab).
7.don't worry about Log file timestamp format, since you don't have
TIMESTAMP field defined in your log format
8. Click 'save configuration as' and browse to where you want to save it and
give it a name (I just entered 'c:\new-logfile-receiver-config.xml' in the
box)
9. Click the 'always start chainsaw with this configuration button'
10. Press ok

Events should show up in a new tab, the tab name being the name of the log
file you chose to process.

If you open the receiver panel you should see a receiver whose name is the
log file you chose to process.

Here is the contents of 'new-logfile-receiver-config.xml' after I did this
(it did create a tab for me, and I have a receiver defined)

?xml version=1.0 encoding=UTF-8?
log4j:configuration xmlns:log4j=http://jakarta.apache.org/log4j/;
debug=true
plugin class=org.apache.log4j.chainsaw.vfs.VFSLogFilePatternReceiver
name=/C:/andyRILog.txt
param name=appendNonMatches value=true/
param name=autoReconnect value=true/
param name=fileURL value=file:/C:/andyRILog.txt/
param name=logFormat value=MESSAGE/
param name=name value=/C:/andyRILog.txt/
param name=promptForUserInfo value=false/
param name=tailing value=true/
param name=timestampFormat value=-MM-dd HH:mm:ss,SSS/
param name=waitMillis value=2000/
/plugin
/log4j:configuration

Again, if you are going to try sftp after this, change promptForUserInfo to
true and change your fileURL.  You can play with the logFormat and
timestampFormat once you have it working as well.

This worked for me out of the box with the developer snapshot you downloaded
from http://people.apache.org/~sdeboy

Scott

On Thu, Jul 21, 2011 at 2:51 PM, Ding, Qin qin.d...@jpmchase.com wrote:

 Scott:

 1. I manually downloaded mylog.log; and define a logfilePatternReceiver
 within chainsaw. Pointing to mylog.log. after that, it just sits there, I
 see nothing.  The last entry in the detail panel: setValueAt, 2, 1,
 value=file:///C:\MyDocs\logs\mylog.log, valueClassclass java.lang.String

 2. I copied the provided configuration file and modified the
 VFSLogFilePatternReceiver and put it in a folder.  Use the instruction you
 gave me to load it.  But on the receiver panel I did not see anything.
  Manually define a VFSLogFilePatternReceiver.  Don't see the GUI prompt for
 id/pwd.

 Would you please give me a detailed the instruction or your working sample
 configuration file?

 Thank you

 QD

 -Original Message-
 From: Scott Deboy [mailto:scott.de...@gmail.com]
 Sent: Thursday, July 21, 2011 1:36 PM
 To: Log4J Users List
 Subject: Re: Help Log4j Chainsaw - VFSLogFilePatternReceiver Usage

 Chainsaw settings are stored in $userhome/.chainsaw - in that folder has a
 chainsaw-settings.xml file that is used to store application-wide
 preferences.  Here is how you can get the 'configurationURL' field to be
 set
 in that file via the GUI:

 Use the file-load Chainsaw configuration menu option, then select 'use a
 chainsaw config file' and browse to it, then check the 'always start
 chainsaw with this configuration' check box.

 Scott


 On Thu, Jul 21, 2011 at 11:29 AM, Ding, Qin qin.d...@jpmchase.com wrote:

  Scott, I already tried by removing the id/pwd and then set true to the
  promptforuserinfo. However, I don't see the GUI. After restarting the
 app, I
  still don't see the GUI. I think this issue might be related to the
  following problem:
 
  How does the app pick up receiver config file in my case log4j.xml?
   Yesterday, I have a log4j.xml file defined and placed it in the chainsaw
  folder.  Today, after I download the new chainsaw and started the app, I
  didn't tell the app where to look for the log4j.xml, but it seems find it
  from the location (old chainsaw) I defined yesterday.  I redefined a new
  log4j.xml and place it under the new chainsaw folder. In application-wide
  preference, I remove the old log4j.xml and use the new log4j.xml.  After
 I
  restarted the app, the log4j.xml in use is still the old one.
 
  I will remove the old the application including the log4j.xml.
 
  QD
 
  -Original Message-
  From: Scott Deboy [mailto:scott.de...@gmail.com]
  Sent: Thursday, July 21, 2011 1:14 PM
  To: Log4J Users List
  Subject

Re: Help Log4j Chainsaw - VFSLogFilePatternReceiver Usage

2011-07-20 Thread Scott Deboy
Are you using the latest developer snapshot of Chainsaw, available here?

http://people.apache.org/~sdeboy

If not, please try it and follow-up with your results.

Thanks

Scott

On Wed, Jul 20, 2011 at 12:18 PM, Ding, Qin qin.d...@jpmchase.com wrote:

 I am trying to view the log4j log using
 VFSLogFilePatternReceiverNoUserInfoPrompt.

 Here is my log4j.xml:



 plugin name=VFSLogFilePatternReceiverNoUserInfoPrompt
 class=org.apache.log4j.chainsaw.vfs.VFSLogFilePatternReceiver

 param name=fileURL value=sftp://
 myid:my...@serverhost.xxx.yy.net//complete/path/to/logs/mylog.log/

 param name=timestampFormat value=-MM-dd HH:mm:ss,SSS/

 param name=logFormat value=[TIMESTAMP] LEVEL THREAD
 (FILE:METHOD:LINE) -MESSAGE/

 param name=name value=VFSLogFilePatternReceiver/

 param name=tailing value=true/

   /plugin



 Start the chainsaw with this log4j.xml. Get the following msg:



 attempting to load file: sftp://
 myid:my...@serverhost.xxx.yy.net//complete/path/to/logs/mylog.log

 file not available - will try again in 10 seconds



 The file is there at the remote site, I can sftp to it.  Why can chainsaw
 find it?

 I tried the following with or without port number:



 param name=fileURL value=sftp://
 myid:my...@serverhost.xxx.yy.net/complete/path/to/logs/mylog.log/

 param name=fileURL value=sftp://
 myid:my...@serverhost.xxx.yy.net//complete/path/to/logs/mylog.log/

 param name=fileURL value=sftp://
 myid:my...@serverhost.xxx.yy.net///complete/path/to/logs/mylog.log/

 param name=fileURL value=sftp://
 myid:my...@serverhost.xxx.yy.netcomplete/path/to/logs/mylog.log/



 None of these work. I saw someone suggest to create a .ssh folder under
 user home and create a known_hosts file with the host name it.  I did that
 without help.



 Please help. Thank you.



 QD



 This communication is for informational purposes only. It is not
 intended as an offer or solicitation for the purchase or sale of
 any financial instrument or as an official confirmation of any
 transaction. All market prices, data and other information are not
 warranted as to completeness or accuracy and are subject to change
 without notice. Any comments or statements made herein do not
 necessarily reflect those of JPMorgan Chase  Co., its subsidiaries
 and affiliates.

 This transmission may contain information that is privileged,
 confidential, legally privileged, and/or exempt from disclosure
 under applicable law. If you are not the intended recipient, you
 are hereby notified that any disclosure, copying, distribution, or
 use of the information contained herein (including any reliance
 thereon) is STRICTLY PROHIBITED. Although this transmission and any
 attachments are believed to be free of any virus or other defect
 that might affect any computer system into which it is received and
 opened, it is the responsibility of the recipient to ensure that it
 is virus free and no responsibility is accepted by JPMorgan Chase 
 Co., its subsidiaries and affiliates, as applicable, for any loss
 or damage arising in any way from its use. If you received this
 transmission in error, please immediately contact the sender and
 destroy the material in its entirety, whether in electronic or hard
 copy format. Thank you.

 Please refer to http://www.jpmorgan.com/pages/disclosures for
 disclosures relating to European legal entities.


Re: How do I hook in before log4j starts?

2011-07-19 Thread Scott Deboy
That sounds like a bug that should be fixed.  Mind submitting a bug?  If you
want to provide a patch we'd be happy to review it.

Thanks

Scott

On Tue, Jul 19, 2011 at 12:18 PM, Turner, Jay jay.tur...@sabre-holdings.com
 wrote:

 I can do some lazy initialization, but there is still a basic problem.

 Looking at the source code for LogManager, I find that it has a static
 block of code. This static block will run as I try to do anything with
 LogManager. I can get it down to LogManager.setRepositorySelector(rs,guard)
 without trigerring the static block in LogManager. The mere call to
 setRepositorySelector runs the static block first, which runs code that
 calls OptionConverter.selectAndConfigure(...) unless
 log4j.defaultInitOverride is set.

 So there is no way to prepare log4j before it initializes unless the user
 is kind enough to set log4j.defaultInitOverride or define
 log4j.configuratorClass. Both of these require the user - instead of the
 library handling the logging on behalf of the user - to setup the
 environment correctly and without conflicting with any other application.

 Thank you,
 Jay Turner

 -Original Message-
 From: Scott Deboy [mailto:scott.de...@gmail.com]
 Sent: Monday, July 18, 2011 5:47 PM
 To: Log4J Users List
 Subject: Re: How do I hook in before log4j starts?

 Can you lazily initialize the ref to the root logger in your
 LoggerRepositoryHandler instead of passing it in to the constructor?  It
 seems like that should resolve your problem.

 Scott

 On Mon, Jul 18, 2011 at 3:02 PM, Turner, Jay
 Jay.Turner@sabre-holdin gs.comwrote:

  The inherited code did have some public static final
  org.apache.log4j.Logger ... calls, thank you. Changing those allowed my
  code to be called first. However a Catch-22 still exists. Trying:
 
 private static final Object guard = new Object();
 private static final LoggerRepositoryHandler handler =
  setupLoggerRepositoryHandler();
 
 private static LoggerRepositoryHandler setupLoggerRepositoryHandler()
 {
 LoggerRepositoryHandler handle =
 new
 
 LoggerRepositoryHandler(org.apache.log4j.LogManager.getLoggerRepository().getRootLogger());
 
 org.apache.log4j.LogManager.setRepositorySelector(new
  RepositorySelector() {
 public LoggerRepository getLoggerRepository() {
 return handler;
 }}, guard
 );
 
 return handle;
 }
 
  This gets called first, but the
  org.apache.log4j.LogManager.getLoggerRepository() call to link my
 repository
  with the default repository invokes the log4j setup, which completes and
  uses the default repository before my new repository (with the
  parseUnrecognizedElement method) is setup. If I set the selector first
 then
  when I call getLoggerRepository() it will go through my selector which
 has
  no default repository setup.
 
  I can't get ahold of the log4j system to link in my
  parseUnrecognizedElement method first without letting log4j setup
 everything
  first.
 
  How has anyone every hooked parseUnrecognizedElement into log4j before it
  starts up?
 
  I just need to process multiple non-logger/appender-specific
 myKey=myValue
  parameters like this:
 
 ?xml version=1.0 encoding=UTF-8?
 !DOCTYPE log4j:configuration SYSTEM log4j.dtd
 
 log4j:configuration xmlns:log4j=http://jakarta.apache.org/log4j/;
  debug=true
 
 param name=myKey value=myValue/
 
  Thank you,
  Jay Turner
 
   From: Scott Deboy ... more likely a static logger declaration or a
 logger
  instance
   be initialized prior to your configuration code being ran.
 
 
  -
  To unsubscribe, e-mail: log4j-user-unsubscr...@logging.apache.org
  For additional commands, e-mail: log4j-user-h...@logging.apache.org
 
 

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




Re: How do I hook in before log4j starts?

2011-07-18 Thread Scott Deboy
log4j initialization is running because of explicit programmatic
configuration (via PropertyConfigurator/DOMConfigurator) or more likely a
static logger declaration or a logger instance be initialized prior to your
configuration code being ran.

I'd suggest changing your logger declarations to be non-static and moving
your initialization logic into a static block at the top of the first class
that is being loaded.

Scott

On Mon, Jul 18, 2011 at 1:47 PM, Turner, Jay
jay.tur...@sabre-holdings.comwrote:

 I call my Library Jar which has log4j setup in it. I'm calling a static
 method in my class. Before I can get to the
 LogManager.setRepositorySelector, log4j gets to run, loads its configuration
 from log4j.configuration, can't interpret the unrecognized parameters, and
 generally finishes initialization. I suspect that when I enter the Library
 to run a static method that all of the other statics are run, along with the
 statics in log4j.jar. So log4j initializes before you can get a chance to
 setup anything. Unless I'm missing something, how can I get around this
 Catch-22?

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




Re: How do I hook in before log4j starts?

2011-07-18 Thread Scott Deboy
Can you lazily initialize the ref to the root logger in your
LoggerRepositoryHandler instead of passing it in to the constructor?  It
seems like that should resolve your problem.

Scott

On Mon, Jul 18, 2011 at 3:02 PM, Turner, Jay
jay.tur...@sabre-holdings.comwrote:

 The inherited code did have some public static final
 org.apache.log4j.Logger ... calls, thank you. Changing those allowed my
 code to be called first. However a Catch-22 still exists. Trying:

private static final Object guard = new Object();
private static final LoggerRepositoryHandler handler =
 setupLoggerRepositoryHandler();

private static LoggerRepositoryHandler setupLoggerRepositoryHandler() {
LoggerRepositoryHandler handle =
new
 LoggerRepositoryHandler(org.apache.log4j.LogManager.getLoggerRepository().getRootLogger());

org.apache.log4j.LogManager.setRepositorySelector(new
 RepositorySelector() {
public LoggerRepository getLoggerRepository() {
return handler;
}}, guard
);

return handle;
}

 This gets called first, but the
 org.apache.log4j.LogManager.getLoggerRepository() call to link my repository
 with the default repository invokes the log4j setup, which completes and
 uses the default repository before my new repository (with the
 parseUnrecognizedElement method) is setup. If I set the selector first then
 when I call getLoggerRepository() it will go through my selector which has
 no default repository setup.

 I can't get ahold of the log4j system to link in my
 parseUnrecognizedElement method first without letting log4j setup everything
 first.

 How has anyone every hooked parseUnrecognizedElement into log4j before it
 starts up?

 I just need to process multiple non-logger/appender-specific myKey=myValue
 parameters like this:

?xml version=1.0 encoding=UTF-8?
!DOCTYPE log4j:configuration SYSTEM log4j.dtd

log4j:configuration xmlns:log4j=http://jakarta.apache.org/log4j/;
 debug=true

param name=myKey value=myValue/

 Thank you,
 Jay Turner

  From: Scott Deboy ... more likely a static logger declaration or a logger
 instance
  be initialized prior to your configuration code being ran.


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




Re: I need to handle log4j:WARN Unrecognized element param

2011-07-15 Thread Scott Deboy
Here's how Chainsaw does it:

1. Create your own LoggerRepository implementation that implements
unrecognizedelementhandler (Chainsaw uses LoggerRepositoryExImpl from the
components companion).

LogManager.setRepositorySelector(new RepositorySelector() {

  public LoggerRepository getLoggerRepository() {
  return repositoryExImpl;
  }}, repositorySelectorGuard);

Then you can call DOMConfigurator.configure and it'll pass those
unrecognized elements to your repository selector impl.

Scott

On Fri, Jul 15, 2011 at 3:02 PM, Turner, Jay
jay.tur...@sabre-holdings.comwrote:

 I get log4j:WARN Unrecognized element param because we have some extra
 entries in the log4j 1.2.15 XML configuration file at the root level.

 The code uses
 DOMConfigurator configurator = new DOMConfigurator();
 configurator.doConfigure(inputStream,
 org.apache.log4j.LogManager.getLoggerRepository());

 The LoggerRepository returned doesn't implement UnrecognizedElementHandler
 (or at least not that I know how to connect to it).
 I thought of using
 class ExtendedLoggerRepository extends
 org.apache.log4j.LoggerRepositoryExImpl {
public boolean parseUnrecognizedElement(
org.w3c.dom.Element element,
java.util.Properties props)
throws java.lang.Exception {
// My code
}
}
configurator.doConfigure(
inputStream,
new
 ExtendedLoggerRepository(org.apache.log4j.LogManager.getLoggerRepository()));

 But my IntelliJ says that LoggerRepositoryExImpl, which is a public final
 class, is not in that package nor the spi subpackage.

 What is the right way of using the default logger repository but hooking in
 so that I can parse extra parameters as in:
 ?xml version=1.0 encoding=UTF-8?
 !DOCTYPE log4j:configuration SYSTEM log4j.dtd
 log4j:configuration xmlns:log4j=http://jakarta.apache.org/log4j/;
 debug=true
 param name=somename value=somevalue/
 :

 Thank you,
 Jay Turner






  1   2   3   4   5   6   >