When running chainsaw, I add the path to the log4j-receiver-sample.xml to my classpath...here's the contents of a .bat file I run to start it.
NOTE: (the xml file is in the same directory as this batch file, that's the reason for '.' in the classpath.) java -Dlog4j.configuration=log4j-receiver-sample.xml -classpath .;log4j.jar;jaxp.jar;crimson.jar org.apache.log4j.chainsaw.LogUI -----Original Message----- From: Jim Moore [mailto:[EMAIL PROTECTED] Sent: Wednesday, June 18, 2003 1:28 PM To: 'Log4J Developers List' Subject: RE: Testing Chainsaw v2 -Dlog4j.configuration wants a URL. That means you have to use the "file:" (ie, "-Dlog4j.configuration=file:myLog4j.xml") -----Original Message----- From: Scott Heaberlin [mailto:[EMAIL PROTECTED] Sent: Wednesday, June 18, 2003 4:22 PM To: Log4J Developers List Subject: RE: Testing Chainsaw v2 Thanks a ton Scott for your help. Just an FYI though - I was unable to get -Dlog4j.configuration=<some path to xml config> to work though. The only way I could get chainsaw2 to use an xml configuration was to "cheat", rename the desired xml file to "log4j.xml" and add its dir to the classpath before starting Chainsaw v2. Just thought you'd want to know, -Scott --- Scott Deboy <[EMAIL PROTECTED]> wrote: > For each appender defined on the event source side, > you need a matching 'receiver' (defined as a > 'plugin' in the configuration file) for Chainsaw to > receive events from the matching appender. > > See the src/config/log4j-appender-sample.xml and > src/config/log4j-receiver-sample.xml files for example source and sink > configurations, respectively. > > Configure your app to use the appenders defined in > the sample appender config with: > -Dlog4j.configuration=log4j-appender-sample.xml. > > Do the same for Chainsaw but with the receiver > sample: > -Dlog4j.configuration=log4j-receiver-sample.xml. > > ChainsawV2 is also an appender itself and the appender-sample.xml > demonstrates how it can be started automatically (see the LogUI > appender section in the log4j-appender-sample.xml). > > Two other receivers are new but sample > configurations aren't provided: > JDBCReceiver - works with the existing > JDBCAppender > XMLSocketReceiver - works with JDK1.4 > socket/XML-formatted events. > > The jdbcreceiver example is based on mysql. See the > javadoc for more information. > > The XMLSocketReceiver requires a 'decoder' to do the > work of converting from XML conforming to a DTD to a loggingevent. > Two decoders exist - one for Log4J's dtd and one for JDK1.4's dtd. > > Here are sample configurations for using the > JDBCReceiver or XMLSocketReceiver: > > <plugin name="JDBCReceiver" > class="org.apache.log4j.jdbc.JDBCReceiver"> > <param name="refreshMillis" value="5000"/> > <param name="password" value=""/> > <param name="user" value="root"/> > <param name="driver" > value="org.gjt.mm.mysql.Driver"/> > <param name="sql" value='select logger as LOGGER, timestamp as > TIMESTAMP, level as LEVEL, thread as THREAD, message as MESSAGE, ndc > as NDC, mdc as MDC, class as CLASS, method as METHOD, file as FILE, > line as LINE, > concat("{{log4japp,databaselogs,log4jmachinename,mymachine,log4jid,", > COUNTER, "}}") as PROPERTIES, "" as EXCEPTION from logtable'/> > <param name="URL" > value="jdbc:mysql://127.0.0.1/test"/> > </plugin> > > <plugin name="XMLSocketReceiver" > class="org.apache.log4j.net.XMLSocketReceiver"> > <param name="decoder" > value="org.apache.log4j.xml.UtilLoggingXMLDecoder"/> > <param name="Port" value="2222"/> > </plugin> > > We'll be documenting things more completely in the > near future. > > Hope this helps, > Scott ===== ============================== Scott Heaberlin [EMAIL PROTECTED] [EMAIL PROTECTED] ============================== __________________________________ Do you Yahoo!? The New Yahoo! Search - Faster. Easier. Bingo. http://search.yahoo.com --------------------------------------------------------------------- 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] --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]