logging-log4net-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Hart, Leo" <Leo.H...@FMR.COM>
Subject RE: Using %C, %F, %l, %L and %M in ConversionPattern
Date Thu, 14 Jul 2005 20:27:20 GMT
Here's what I get for 100,000 log entries:

Debug - %M: 17 secs
Debug - No %M: 3 secs
Release - %M: 15 secs
Release - No %M: 3 secs




-----Original Message-----
From: Hart, Leo 
Sent: Thursday, July 14, 2005 4:06 PM
To: Log4NET User
Subject: RE: Using %C, %F, %l, %L and %M in ConversionPattern


It appears the name can be extracted in release mode (I just tried it
out).  No idea how it affects performance.  I'm going to try running
some tests out on my own here.  I'll let you know what I see.

-----Original Message-----
From: Ron Grabowski [mailto:rongrabowski@yahoo.com] 
Sent: Thursday, July 14, 2005 3:52 PM
To: Log4NET User
Subject: Re: Using %C, %F, %l, %L and %M in ConversionPattern


Can the method name be extracted in Release mode as well?

How does building in Debug or Release mode affect the timings on your
machine?

--- Niall Daley <niall@apache.org> wrote:

> Leo,
> 	In order to generate the method name log4net has to throw an
> exception and check the stack trace so, yes, it is very much slower 
> than not doing so. As a rough guide line, on my machine it takes
> approximately
> 0.5 seconds to log 10000 messages with out %M and 6.4 seconds with it
> in
> the pattern. If you really want to use this you should evaluate the
> performance penalty in your own environment however.
> 
> 		Niall
> 
> On Thu, 14 Jul 2005, Hart, Leo wrote:
> 
> > Hello,
> >
> > I'm interested in added method name data in my logging messages, so
> I've
> > set up my RollingFileAppender like this:
> >
> > 	<appender name="File - Support"
> > type="log4net.Appender.RollingFileAppender">
> > 	  <param name="File" 
> > value="c:\\LogFiles\\ReferenceApp\\ReferenceApp" />
> > 	  <param name="AppendToFile" value="true" />
> > 	  <param name="DatePattern" value="  - yyyy-MM-dd.'log'" />
> > 	  <param name="RollingStyle" value="Date" />
> > 	  <param name="StaticLogFileName" value="false" />
> > 	  <layout type="log4net.Layout.PatternLayout">
> > 	   <param name="ConversionPattern" value="%-5p | %d{yyyy-MM-dd 
> > HH:mm:ss, fff} | %t | %c | %M | %t | %m%n" />
> > 	  </layout>
> > 	 </appender>
> >
> > %M tells Log4Net to output the name of the method within which the
> > logging statement was generated.
> >
> > Now, I have Ceki Culcu's book for log4j (I was a Java developer in
> a
> > previous life).  Within that he states:
> >
> > 	On certain platforms, generating the caller class information
can 
> > be excruciatingly slow.  Thus, the user of the C, F, l, L, and
> M
> > conversion characters should be avoided unless execution speed is
> not an
> > issue.
> >
> > My question is, given that I'm using Log4Net (1.2.8b) and not Log4J
> and
> > my platform is .NET 1.1, is this statement still true?  And if so,
> does
> > anyone have any benchmarks indicating how much of a performance
> penalty
> > will be taken for using the %M character?
> >
> > Thanks,
> > Leo Hart
> >
> 
> --
> Niall Daley
> Log4net Dev
> 

Mime
View raw message