Is your goal not to necessarily view the events in real time, but to aggregate 
the events from the variousi machines into a single log file?

If that's what you're interested in, I'd suggest using a SimpleSocketServer 
configured with the various logfilepatternreceivers, and a single fileAppender.

You could then configure Chainsaw with a LogFilePatternReceiver that will 
process the aggregated log file.

The reason for including consoleappender in the sample config is mostly for 
sanity checking - the consoleappender will display any events received by any 
receiver (useful if you're having network/firewall issues and using network 
receivers).

By the way, with log4j 1.3, there are a number of new appenders that may make 
sense in your environment - MulticastAppender, UDPAppender, as well as a new 
DBAppender (and there are matching receivers for each of these appenders).

There are also two socket-based appenders/receivers available with log4j 1.2.9
 - SocketHubAppender/SocketHubReceiver - Receiver knows the IP address of the 
machine providing events (any number of machines can connect to the 
socketHubAppender)

 - SocketAppender/SocketReceiver - Appender knows the IP address of the machine 
receiving the events

One more thing: with log4j1.3 we added a configurable buffer to 
SocketHubAppender - by default no buffering is provided.

Hope that helps -
If you have more questions, let us know

Scott



-----Original Message-----
From:   Robert Vaessen [mailto:[EMAIL PROTECTED]
Sent:   Fri 3/4/2005 6:08 AM
To:     'Log4J Users List'
Cc:    
Subject:        RE: Chainsaw Configuration
Scott,

        Thank you for the good information and for the care that you
took to express it clearly.

        I still have some misgivings. The use of the LogFileReceiver
requires that the names and locations of the log files are known and
accessible. This can become problematic when the producers of those log
files are distributed across several machines and are possibly starting
and ending on an as needed basis. (We are making use of Agent technology
and are exploring Grid computing.)      Chainsaw's network receivers are
just right: many remote logging event producers funneling into a central
logging location.

        Your first statement ("Chainsaw requires its own configuration
file that provide receiver definitions - separate from the config files
that provide appender definitions.") goes to the root of what my
misconceptions may be. I perceive Chainsaw as an "extension" of log4j
that introduces the concept of "Receivers". These receivers gather
logging events from external sources and then "dump them into" the host
process' (i.e. Chainsaw) internal log4j logging system. The internal
logging system is then configured with appenders that work in the normal
way. So, what I thought that I could do was to configure some Receivers
and also configure the "internal logging system" to use a
RollingFileAppender. The fact that the "example Receiver configuration"
on Chainsaw's Welcome tab includes the definition of a ConsoleAppender
made me think that this was possible.

        So, what do you think? Am I thinking about this in a reasonable
way or am I missing the boat?

Best Regards,
Robert Vaessen

-----Original Message-----
From: Scott Deboy [mailto:[EMAIL PROTECTED]
Sent: Friday, March 04, 2005 12:32 AM
To: Log4J Users List
Subject: RE: Chainsaw Configuration

One correction..each of the name fields as well as name params should be
different for each receiver (copied & pasted but should have changed
those fields). 

Change the names to anything you want, but this will help you identify
the individual receivers from inside Chainsaw (you can
restart/remove/define receivers from inside the Chainsaw).

Here's a corrected chainsaw-config.xml example:

<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE log4j:configuration >
<log4j:configuration xmlns:log4j="http://jakarta.apache.org/log4j/";
debug="true">

 <plugin name="LogFileReceiver1"
class="org.apache.log4j.varia.LogFilePatternReceiver">
     <param name="fileURL"
value="file:///c:/Nexus/Home/Cimulate/Prototype/Chainsaw.log"/>
     <param name="timestampFormat" value="yyyy-MM-dd HH:mm:ss,SSS"/>
     <param name="logFormat" value="LEVEL - MESSAGE"/>
     <param name="name" value="sampleLogFileReceiver1"/>
     <param name="tailing" value="true"/>
   </plugin>

 <plugin name="LogFileReceiver2"
class="org.apache.log4j.varia.LogFilePatternReceiver">
     <param name="fileURL"
value="file:///c:/Nexus/Home/Cimulate/Prototype/Chainsaw2.log"/>
     <param name="timestampFormat" value="yyyy-MM-dd HH:mm:ss,SSS"/>
     <param name="logFormat" value="LEVEL - MESSAGE"/>
     <param name="name" value="sampleLogFileReceiver2"/>
     <param name="tailing" value="true"/>
   </plugin>

 <plugin name="LogFileReceiver3"
class="org.apache.log4j.varia.LogFilePatternReceiver">
     <param name="fileURL"
value="file:///c:/Nexus/Home/Cimulate/Prototype/Chainsaw3.log"/>
     <param name="timestampFormat" value="yyyy-MM-dd HH:mm:ss,SSS"/>
     <param name="logFormat" value="LEVEL - MESSAGE"/>
     <param name="name" value="sampleLogFileReceiver3"/>
     <param name="tailing" value="true"/>
   </plugin>

   <root>
      <level value="debug"/>
   </root>
</log4j:configuration>


-----Original Message-----
From:   Scott Deboy
Sent:   Thu 3/3/2005 9:28 PM
To:     Log4J Users List
Cc:    
Subject:        RE: Chainsaw Configuration
Chainsaw can process events from multiple log files.

Chainsaw requires its own configuration file that provide receiver
definitions - separate from the config files that provide appender
definitions.

To process multiple log files, create multiple 'plugin' sections in
Chainsaw's config file - one for each log file you'd like to receive.
I've included an example below.

In the example below, if your log file doesn't contain a timestamp
field, it doesn't matter what the timestampFormat field in the
logFilePatternReceiver configuration contains.  With a simple layout,
that's the case - simple layout only provides LEVEL, a dash, and the
message.

To take advantage of Chainsaw's features, you may want to change the
file appender layouts to include a logger (use PatternLayout).

I've included below an example config file demonstrating how to create a
chainsaw config file that processes events from 3 log files..

Save this file with any name you'd like, and in Chainsaw's
application-wide prefs screen, set the 'configuration URL' field to the
url pointing to this file.  For example, save the file as
chainsaw-config.xml on the root of your C drive, and set the
'configuration URL' field to 'file:///c:/chainsaw-config.xml' (minus the
single quotes)

Notice in the log file that the only difference is the value of the
'fileURL' param.  Also notice there are no appenders defined - only
receivers.  If you used different layouts for the different log files,
you must modify the logFormat param for the associated receiver to match
the layout provided by the appender.

chainsaw-config.xml
---------------
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE log4j:configuration >
<log4j:configuration xmlns:log4j="http://jakarta.apache.org/log4j/";
debug="true">

 <plugin name="LogFileReceiver"
class="org.apache.log4j.varia.LogFilePatternReceiver">
     <param name="fileURL"
value="file:///c:/Nexus/Home/Cimulate/Prototype/Chainsaw.log"/>
     <param name="timestampFormat" value="yyyy-MM-dd HH:mm:ss,SSS"/>
     <param name="logFormat" value="LEVEL - MESSAGE"/>
     <param name="name" value="sampleLogFileReceiver"/>
     <param name="tailing" value="true"/>
   </plugin>

 <plugin name="LogFileReceiver"
class="org.apache.log4j.varia.LogFilePatternReceiver">
     <param name="fileURL"
value="file:///c:/Nexus/Home/Cimulate/Prototype/Chainsaw2.log"/>
     <param name="timestampFormat" value="yyyy-MM-dd HH:mm:ss,SSS"/>
     <param name="logFormat" value="LEVEL - MESSAGE"/>
     <param name="name" value="sampleLogFileReceiver"/>
     <param name="tailing" value="true"/>
   </plugin>

 <plugin name="LogFileReceiver"
class="org.apache.log4j.varia.LogFilePatternReceiver">
     <param name="fileURL"
value="file:///c:/Nexus/Home/Cimulate/Prototype/Chainsaw3.log"/>
     <param name="timestampFormat" value="yyyy-MM-dd HH:mm:ss,SSS"/>
     <param name="logFormat" value="LEVEL - MESSAGE"/>
     <param name="name" value="sampleLogFileReceiver"/>
     <param name="tailing" value="true"/>
   </plugin>

   <root>
      <level value="debug"/>
   </root>
</log4j:configuration>

-----------------
Hope this helps -

Once you have this working, you can change the application-wide prefs -
tab identifier - field to change the way events are routed (possibly
aggregating the events from the different log files into a single tab)

If you have more questions, let us know

Scott


-----Original Message-----
From:   Robert Vaessen [mailto:[EMAIL PROTECTED]
Sent:   Thu 3/3/2005 5:55 PM
To:     'Log4J Users List'
Cc:   
Subject:        RE: Chainsaw Configuration
I am using Chainsaw to log events from an application whose processing
is distributed across a mix of java and .net processes. Currently, each
of these processes is producing a log file via a RollingFileAppender. I
am considering that it might be nice to have a single file that
aggregates the output from all of the application's components just as
is happening on the Chainsaw Logging Panel. So:
        1) Your reply indicates that this can be done but it isn't
working for me (see my Config file with the previous post).
        2) If you think that this is a bad idea then I'd really like to
have the benefit of your thoughts.

Best Regards,
Robert

-----Original Message-----
From: Scott Deboy [mailto:[EMAIL PROTECTED]
Sent: Thursday, March 03, 2005 1:24 PM
To: Log4J Users List
Subject: RE: Chainsaw Configuration

If your Chainsaw config file includes an appender, the appender will
process events received by Chainsaw (for example, a fileAppender hooked
up to Chainsaw would write any events received by Chainsaw to the log
file, and you probably don't want that to happen)..

For Chainsaw to read log files, you need to add a LogFilePatternReceiver
to the config file.

Here's the example from the sample config:

 <plugin name="LogFileReceiver"
class="org.apache.log4j.varia.LogFilePatternReceiver">
     <param name="fileURL" value="file:///c:/sample.log"/>
     <param name="timestampFormat" value="yyyy-MM-dd HH:mm:ss,SSS"/>
     <param name="logFormat" value="TIMESTAMP LEVEL [LOGGER] MESSAGE"/>
     <param name="name" value="sampleLogFileReceiver"/>
     <param name="tailing" value="true"/>
   </plugin>

Chainsaw's config file can have any name, it just needs to be accessible
as a URL (and specified as a URL in the application-wide preferences
screen)

Scott

-----Original Message-----
From:   Robert Vaessen [mailto:[EMAIL PROTECTED]
Sent:   Thu 3/3/2005 9:57 AM
To:     'Log4J Users List'
Cc:  
Subject:        RE: Chainsaw Configuration
Hello Dirk,

        Thank you very much. I am a bit embarrassed that I didn't notice
that on my own.

        Do you have any comments on the second part of my question
(configuring Chainsaw to use a Rolling File Appender)? It doesn't seem
to be working for me. I've pasted in my config file below.

Robert

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

<plugin name="UDPReceiver" class="org.apache.log4j.net.UDPReceiver">
  <param name="Port" value="4446"/>
</plugin>

<plugin name="SocketReceiver"
class="org.apache.log4j.net.SocketReceiver">
  <param name="Port" value="4560"/>
</plugin>

<appender name="RollingFile"
class="org.apache.log4j.RollingFileAppender">
  <param name="File"
value="C:/Nexus/Home/Cimulate/Prototype/Chainsaw.log"/>
  <param name="Append" value="true"/>
  <param name="MaxFileSize" value="100KB"/>
  <param name="maxBackupIndex" value="2"/>
  <layout class="org.apache.log4j.SimpleLayout"/>
/appender>
 
<root>
  <priority value="debug"/>
  <appender-ref ref="RollingFile"/>
/root>

     

</log4j:configuration>

-----Original Message-----
From: OOMS DIRK [mailto:[EMAIL PROTECTED]
Sent: Thursday, March 03, 2005 11:13 AM
To: 'Log4J Users List'
Subject: RE: Chainsaw Configuration

At the moment you can not specify this "plugin config" as a System
Property,
but you can specify it via the menu "Show Application wide preferences"
and
then "Automatic Configuration URL" (in fact this info is stored in the
file
chainsaw.settings.properties as configurationURL). You can specify this
url
using file, http or ftp.

dirk

> -----Original Message-----
> From: Robert Vaessen [mailto:[EMAIL PROTECTED]
> Sent: donderdag 3 maart 2005 17:07
> To: [email protected]
> Subject: Chainsaw Configuration
>
>
> Hello,
>
>
>
>             I am currently configuring my Chainsaw receivers via the
> "You have no Receivers defined." dialog that pops up when Chainsaw
> starts. I have seen the "example Receiver configuration" on Chainsaw's
> Welcome tab and from it infer that I can place a configuration file
> somewhere and have Chainsaw load it. But, try as I may, I cannot
> discover how to do this. I know how to do it with Log4j, but I am
> confused with regards to system options and class paths when
> it comes to
> Java Web Start (which is how I am running Chainsaw).
>
>
>
>             So, my questions are:
>
>
>
>             1) With what name and in what location can I create a
> Chainsaw configuration file?
>
>             2) Can I, as the example implies, configure Chainsaw's
> internal logging system via this file? More specifically, can I
> configure a Rolling File Appender that aggregates the logging events
> from all of my remote appenders.
>
>
>
>             Thank you for your time and consideration.
>
>
>
> Best Regards,
>
> Robert Vaessen
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to