logging-log4net-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ron Grabowski <rongrabow...@yahoo.com>
Subject Re: Using %C, %F, %l, %L and %M in ConversionPattern
Date Thu, 14 Jul 2005 19:51:33 GMT
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