How to view logs on my remote server from my chainsaw running on local

In my log4j.properties

Define a socket application sending 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 chainaw.bat and define a socket listener listening on port 29678 and wola. I see logs from my local on a chainsaw.

But when I deploy my application to 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 also define and sockethubreciever with host vlslcsdbx04.regence.com and port 29678, Chainsaw doesn't seem to want to connect.

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

+3


source to share


1 answer


You have to use SocketHubAppender in the remote remote server log4j config file with Chainsaw SocketHubReceiver entry so Chainsaw can connect to the remote server.

Also, I would suggest trying out the latest developer snapshot of Chainsaw - available here - lots of new features / fixes:



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

+1


source







All Articles