You are viewing a plain text version of this content. The canonical link for it is here.
Posted to log4j-user@logging.apache.org by Bender Heri <HB...@Ergonomics.ch> on 2007/07/05 10:45:49 UTC

RE: [SPAM (Bayesain Analysis)] - How to always log the host name? - Bayesian Filter detected spam

Put the hostname somewhere at app start into MDC:

  MDC.put( "hostname", myHostname );

The conversionPattern can resolve MDC values by using the switch %X{<ID>}. The ID in my example is "hostname" (without quotes).

Heri


> -----Original Message-----
> From: Hans Schwaebli [mailto:hans_schwaebli@yahoo.com]
> Sent: Wednesday, July 04, 2007 3:56 PM
> To: log4j-user@logging.apache.org
> Subject: [SPAM (Bayesain Analysis)] - How to always log the 
> host name? -
> Bayesian Filter detected spam
> 
> 
> How can I configure the log4j logging to add the hostname 
> information into the logging output?
>    
>   Most naturally would be to find a conversion character for 
> the hostname in the PatternLayout. But there is none.
> 
>        
> ---------------------------------
> Building a website is a piece of cake. 
> Yahoo! Small Business gives you all the tools to get online.
> 

---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org
For additional commands, e-mail: log4j-user-help@logging.apache.org