Joe,
That does sound rather surprising, I would not expect an application to
run slower when producing less logging.
How have you written your Debug log statements?
log.Debug("xxx");
or
if (log.IsDebugEnabled) log.Debug("xxx");
The %L pattern will affect performance because is needs to generate a
stack trace, however it should not get more expensive when logging less.
You could try removing it and seeing if that makes any difference.
What happens to the timings if you comment out all the Debug statements
(global search and replace) but leave the logging level at Debug?
Cheers,
Nicko
> -----Original Message-----
> From: Joe Becknell [mailto:[EMAIL PROTECTED]
> Sent: 02 September 2005 17:06
> To: [email protected]
> Subject: Slow Performance
>
> I have an application that does some database lookups and
> writes some reports based on the information. I'm using
> log4net as the logging mechanism. I have a log4net XML config
> file where I'm setting up appender, log levels, etc.
>
> <log4net>
> <appender name="FileAppender" type="log4net.Appender.FileAppender">
> <file value="debug.log" />
> <appendToFile value="false" />
> <layout type="log4net.Layout.PatternLayout">
> <conversionPattern value="%d [%t] %-5p %-28c (Line:
> %L) - %m%n" />
> </layout>
> </appender>
> <root>
> <level value="DEBUG" />
> <appender-ref ref="FileAppender" />
> </root>
> </log4net>
>
> When I have the level set to DEBUG, the application runs in
> about 4 seconds. When I change the level to something lower
> such as INFO or WARN, the app slows down to about 1.75
> minutes. I would expect it to be faster when turning DEBUG
> off. Am I missing something? Has anyone else experienced
> anything like this?
>
> Thanks,
> Joe.
>