Using a 1.2.8 SocketAppender to talk to Chainsaw (1.3) has these limitations:
no MDC
no LocationInfo

By the way, LocationInfo is created as a by-product of defining any pattern 
layout that uses the fields provided by location info.  So, if you are writing 
to a FileAppender that uses these fields in the PatternLayout as well as a 
SocketAppender for Chainsaw, be sure to specify the SocketAppender first in the 
list of appenders.

One way to get LocationInfo in Chainsaw from a 1.2.8 client is to have Chainsaw 
tail a log file that includes all of the LocationInfo fields in its 
patternLayout, and use a LogFilePatternReceiver on the Chainsaw side to parse 
and tail the file.


-----Original Message-----
From:   Ceki Gülcü [mailto:[EMAIL PROTECTED]
Sent:   Mon 11/22/2004 10:01 AM
To:     Log4J Users List
Cc:     
Subject:        Re: SocketAppender questions
At 06:41 PM 11/22/2004, [EMAIL PROTECTED] wrote:
>I have defined a very simple SocketAppender to a log4J 1.2.8 client
>application
>
>
>log4j.appender.SockLog=org.apache.log4j.net.SocketAppender
>log4j.appender.SockLog.RemoteHost=localhost
>log4j.appender.SockLog.Port=4451
>#log4j.appender.SockLog.LocationInfo=true
>log4j.appender.SockLog.Threshold=WARN
>
>
>A very simple SocketReceiver is configured for the "listener" server
>
>  <plugin name="Log4JSocketReceiver"
>class="org.apache.log4j.net.SocketReceiver">
>    <param name="Port" value="4451"/>
>  </plugin>
>
>
>1) I have read about a bug in log4J 1.3 that prevents the LocationInfo
>propertery being set to true.
>         When will this be fixed ? I need the location info for remote
>debugging

You are mixing 1.2.8 and 1.3 on the client and server side? This won't work.


>2) When I have the listener server down and run the client application, I
>expect only a "couldn't connect" terse error message.
>         Instead I get the full java.net.ConnectException + stack trace .
>Not exactly simply dropped.
>         Note this is from the initialization code, not subsequent
>loggings.
>         Is there anyway to avoid this message. I want the application to
>use the socket if it is available, else ignore it.
>         (Note that log4perl handles this very situation very cleanly)

This was supposed to be fixed in 1.3.

-- 
Ceki Gülcü

  The complete log4j manual:  http://qos.ch/eclm
  Professional log4j support: http://qos.ch/log4jSupport  



---------------------------------------------------------------------
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