At 17:14 12.12.2002 -0500, you wrote:

Sorry. I'm not familiar with JMS. This notion of properties just looks like
the MDC to me (and that's exactly how I would handle hostname if it wasn't
natively supported). Is there some other difference? I don't know how these
"properties" work exactly, but I don't want to have to set them at each
logging call.
Very good question. The MDC and the properties field are very similar
but not quite the same. The MDC is sticky, in the sense that it is
enough to set a key once in the MDC for the lifetime of a thread. On
the other hand, a property in the properties field has to be set for
each and every logging event. An appender could very easily do this at a
negligible performance cost (really!).

The MDC will work for me, I think. It's just sub-optimal to have
applications set their hostname when they start up, cuz I still think
hostname is fundamental enough to be supported.
I concede that the hostname case is border line. Adding a hostname
field could work fine.


Note that from the user point there is not much difference between
calling event.setHostname(x) and event.setProperty("hostname", x).

The real question is whether the hostname is set within the
LoggingEvent class or within an appender. I would prefer to do it in
SocketAppender or JMSAppender where the information is certain to be
useful rather than for all cases (in LoggingEvent) where usefulness is
uncertain.

Also, not all machines have a hostname.

dan
--
Ceki



--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to