6

I'd like to start using Chainsaw v2. There is almost no information about it. I've found only this , but links cannot be opened, so it isn't clear.

I use socketAppender:

log4j.rootLogger=DEBUG, server

log4j.appender.server=org.apache.log4j.net.SocketAppender
log4j.appender.server.Port=4712
log4j.appender.server.RemoteHost=localhost
log4j.appender.server.ReconnectionDelay=10000

I created file log4j.xml

<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE log4j:configuration >
<log4j:configuration xmlns:log4j="http://jakarta.apache.org/log4j/" debug="true">
   <appender name="A2" class="org.apache.log4j.ConsoleAppender">
      <layout class="org.apache.log4j.SimpleLayout"/>
   </appender>

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

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

And selected it in let me search for configuration file. But there are no logs. What should I do next?

Bergi
  • 630,263
  • 148
  • 957
  • 1,375
alicjasalamon
  • 4,171
  • 15
  • 41
  • 65

3 Answers3

2

I'm one of the Chainsaw authors. Try the latest developer snapshot of Chainsaw, which will be released soon. It has a new configuration UI which should make it much easier to configure, particularly if all you're doing is using a socket appender.

There are a ton of new features in this version. Feel free to email with questions or post to the log4j-user mailing list.

Developer snapshot available here: http://people.apache.org/~sdeboy

Scott

Scott
  • 1,728
  • 11
  • 11
0

Please use only one file log4j.properties or log4j.xml.And check this article for Chainsaw. It may be helpful to you.

This is sample log4j.properties file for Chainsaw,

  log4j.rootCategory=DEBUG, zeroconf, chainsaw
  # Socket Appender
  log4j.appender.chainsaw=org.apache.log4j.net.SocketAppender
  log4j.appender.chainsaw.remoteHost=localhost
  log4j.appender.chainsaw.port=4445
  log4j.appender.chainsaw.locationInfo=true
Sai Ye Yan Naing Aye
  • 6,622
  • 12
  • 47
  • 65
  • How is it possible to use only one file? First is to configure Logger, second to configure ChainSaw. Could you explain in more details? – alicjasalamon Aug 03 '12 at 08:48
  • I still have some problems. In my program I set `PropertyConfigurator.configure("log4j.properties");` and when I start chainsaw I also can choose a file. Is it the same file? – alicjasalamon Aug 03 '12 at 10:39
0

start server first means in chainsaw log server receiver you can select first socket receiver.

log4j.rootLogger=DEBUG, CHAINSAW_CLIENT

log4j.appender.CHAINSAW_CLIENT=org.apache.log4j.net.SocketAppender log4j.appender.CHAINSAW_CLIENT.RemoteHost=localhost log4j.appender.CHAINSAW_CLIENT.Port=4445
log4j.appender.CHAINSAW_CLIENT.LocationInfo=true

madhu
  • 1,083
  • 3
  • 12
  • 31