3

In my log4j.properties

Define a socket appender that sends messages to the chainsaw

log4j.appender.Chainsaw=org.apache.log4j.net.SocketAppender
log4j.appender.Chainsaw.remoteHost=localhost
log4j.appender.Chainsaw.port=29678
log4j.appender.Chainsaw.locationInfo=true
log4j.appender.Chainsaw.Threshold=INFO

I run chainsaw.bat and define a socket reciever listening on port 29678 and wola I can see the logs from my local on chainsaw.

But when I deploy my app onto our remote server

#Define a socket appender that sends messages to the chainsaw
log4j.appender.Chainsaw=org.apache.log4j.net.SocketAppender
log4j.appender.Chainsaw.remoteHost=vlslcsdbx04.regence.com
log4j.appender.Chainsaw.port=29678
log4j.appender.Chainsaw.locationInfo=true
log4j.appender.Chainsaw.Threshold=INFO

and define and sockethubreciever with host vlslcsdbx04.regence.com and port 29678 , Chainsaw doesnt seem to want to connect.

How do I view logs from my remote server using chainsaw on my local machine?

Community
  • 1
  • 1

1 Answers1

1

You have to use a SocketHubAppender in the remote server-deployed log4j configuration file with a Chainsaw SocketHubReceiver entry to allow Chainsaw to connect to the remote server.

Also, I'd suggest trying the latest developer snapshot of Chainsaw - available here - a lot of new features/fixes:

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

Scott
  • 1,728
  • 11
  • 11
  • Thanks scott I am using the latest chainsaw version and I love it. This morning I was able to view logs from my remote server by creating a VFSLogFilePatternReceiver and pointing to my sftp://username:password@boxname//usr/regence/member-services/logs/familyservice.log – user2048598 Feb 07 '13 at 17:54
  • Is there a way to view log from three different nodes in one tab in chainsaw? Right now logs from different nodes show up in three different tabs – user2048598 Mar 15 '13 at 14:44
  • Yes, you can use the 'view, create tab from expression' menu option, and define an expression that will match all of the events from your three tabs - this expression should work (without quotes): "PROP.hostname exists" - hope that helps – Scott Mar 15 '13 at 17:51