What appenders are you using? I assume one of them is the rolling file
appender?  How large is the log file produced with the setting at DEBUG vs
INFO?
If you need to keep the debug information you can look at
the BufferingForwardingAppender.  The following will buffer 255 messages
before writing to the file, unless there is a WARN or higher message, then
the buffer is flushed immediately.  This should hopefully let the error
message that crashes the system still make it to the log file.:)

 I don't know how your loggers are setup, but you can turn off at that level
as well.

<log4net>

<appender name="BufferingForwardingAppender"
type="log4net.Appender.BufferingForwardingAppender" >
<bufferSize value="255" />
<lossy value="false" />
<evaluator type="log4net.Core.LevelEvaluator">
<threshold value="WARN"/>
</evaluator>
<appender-ref ref="RollingFile" />
</appender>
 <appender name="RollingFile" type="log4net.Appender.RollingFileAppender">
<file value="..\..\log\web.log" />
<appendToFile value="true" />
<maximumFileSize value="100MB" />
<maxSizeRollBackups value="-1" />
<layout type="log4net.Layout.PatternLayout">
<conversionPattern value="%5level [%date] [%thread] %-30.30logger{2}
%message%newline"
/>
</layout>
</appender>
 <root>
<level value="DEBUG" />
<appender-ref ref="BufferingForwardingAppender" />
</root>
</log4net>

On Wed, Feb 25, 2009 at 8:31 AM, Walden H. Leverich <[email protected]
> wrote:

> Graham,
>
> That's not a log4net issue as much as it's an issue in your application.
> Sounds like your application (like many) makes lots of log.Debug()
> calls, to log, um, debug information. By switching the logging from
> DEBUG to INFO you've stopped all those log entries from being written to
> disk. Even more, if your app developers were smart about it, they
> checked the IsDebugEnabled property before making the log.Debug() call,
> so you're not even evaluating the parms to that call, and sometimes that
> can be quite expensive.
>
> So, it's a "known issue" that logging more stuff takes more time, but I
> wouldn't call it a bug.
>
> -Walden
>
> --
> Walden H Leverich III
> Tech Software
> (516) 627-3800 x3051
> [email protected]
> http://www.TechSoftInc.com
>
> Quiquid latine dictum sit altum viditur.
> (Whatever is said in Latin seems profound.)
>

Reply via email to