> -----Original Message-----
> From: Whitner, Tom [mailto:[EMAIL PROTECTED] 
> Sent: 02 February 2005 22:02
> To: [email protected]
> Subject: Additional interesting fields for logging
> 
> 
>         We have been evaluating Enterprise Library from 
> Microsoft.  This package contains a logging block that 
> competes directly with log4net.  So far we still prefer 
> log4net.  However, they have included several other data 
> items in their standard logging event class.  These include 
> Machine Name, Process Id, and Process Name.  Would it be 
> useful to include these in log4net as well?
> 
> - Tom 

The machine name / hostname is currently stored in the
GlobalContext.Properties. This makes it available to all logging events,
it is up to the Layout to pull the information if it is required. For
example the PatternLayout can use %property{log4net:HostName} to
retrieve the hostname.

An app can store any general purpose logging information in the
GlobalContext. If the app wants to know the process id or process name
then in can store that information in the GlobalContext as well. We
could look at adding these values to the GlobalContext by default,
however I don't think that it is a good idea to prefill the
GlobalContext with every conceivable piece of potentially useful data.
The application can choose what additional data is useful.

The logging event does capture the name of the AppDomain in which it is
created (AppDomain.CurrentDomain.FriendlyName). This can be retrieved
through the %appdomain pattern. The AppDomain name is similar to the
process name when the app is run as a console or windows app.

Nicko 

Reply via email to