logging-log4j-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ceki Gülcü <c...@qos.ch>
Subject RE: Hostname support in PatternLayout (patch included)
Date Thu, 12 Dec 2002 23:01:44 GMT
At 17:52 12.12.2002 -0500, you wrote:

>Thanks for the clarification.
>Originally, I had the Layout retrieve the hostname, but since logging
>events can change machines and I want to record where they came from, I
>have to modify LoggingEvent. I have to record the hostname somewhere before
>it gets sent over a SocketAppender, and that must be in the LoggingEvent.
>And then, I'm very wary of extending LoggingEvent cuz it's called
>everywhere. I'll break everything. Thus, the only way to do this is to
>either get the patch applied or use the MDC. I can use the MDC. Properties
>would work too, but stickiness is obviously better.

Is stickiness really better? The hostname could be looked up once and 
subsequently remembered by the SocketAppender. Before sending a logging 
event on the wire, the SocketAppender could set the hostname (which it 
keeps in its memory). The cost is a method call plus a hash lookup followed 
by a variable assignment, in other words "nada" compared to serialization.

>And, yeah, not all machines have a hostname. A co-worker was also wondering
>if they could have more than one, if they have multiple interfaces in some
>complex corporate setting where they have one name from the outside and
>another from the inside. I don't know.


To unsubscribe, e-mail:   <mailto:log4j-dev-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:log4j-dev-help@jakarta.apache.org>

View raw message