logging-log4net-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Nicko Cadell" <ni...@neoworks.com>
Subject RE: onlyFixPartialEventData - only need Logger Name
Date Wed, 15 Dec 2004 15:11:54 GMT
Simon,

The LocationInfo is made up of ClassName, MethodName, FileName and
LineNumber. This is generated by capturing the current call stack and
locating the method that called into log4net. Generating a stack trace
for each logging call can have a performance impact on the application.
Also due to the implementation of optimisations in the runtime JIT it is
possible for the call stack not to be a true representation of the call
state causing the LocationInfo to be incorrect.

The LoggerName is an immutable string, it is always available and it is
not necessary to 'fix' it. The LoggerName is supposed to allow you to
determine the source of the event, typically this is set to the name of
the class which is logging, however this is not enforced, the LoggerName
may be any user defined string.

Setting onlyFixPartialEventData=true will disable generation of the
ClassName, MethodName, FileName and LineNumber but not the LoggerName.

Cheers,

Nicko

> -----Original Message-----
> From: Simon Wallis [mailto:mailing@wallis.ca] 
> Sent: 14 December 2004 17:35
> To: log4net-user@logging.apache.org
> Subject: onlyFixPartialEventData - only need Logger Name
> 
> The log4net docs say we should use 
> onlyFixPartialEventData=true because the location information 
> is "extremely" slow to generate.
> 
> I can live without the class name, method name, line number, 
> but the logger name is necessary. Otherwise how do you know 
> where in your code base the event came from? The logger name 
> contains the class so it's enough info to find your events, 
> but without that how do you locate the source of your events?
> 
> Is it possible to only turn on the Logger Name, keep all the 
> other location info off, and still get good performance?
> 
> Simon.
> 

Mime
View raw message