You are viewing a plain text version of this content. The canonical link for it is here.
Posted to log4net-user@logging.apache.org by Nicko Cadell <ni...@neoworks.com> on 2005/06/02 20:39:21 UTC

RE: AdoNetAppender losing first entry

Richard,

This looks like bug exactly as you have described. If you could go ahead
and create a bug for this in JIRA
http://issues.apache.org/jira/browse/LOG4NET that would be great. I will
look at rewriting that chunk of code with rather more comments.

Cheers,

Nicko

> -----Original Message-----
> From: rgeemail-log4net@yahoo.com [mailto:rgeemail-log4net@yahoo.com] 
> Sent: 20 May 2005 11:34
> To: Log4NET User
> Subject: Re: AdoNetAppender losing first entry
> 
> I've checked the code and think this is an error at line 400 in
> BufferingAppenderSkeleton.cs:
> 
> if (discardedLoggingEvent != null && m_lossyEvaluator != null &&
> m_lossyEvaluator.IsTriggeringEvent(discardedLoggingEvent))
> 
> If you don't give a lossy evaluator the event is discarded, 
> regardless of whether the buffer is lossy or not.  This line 
> should also check if the buffer is lossy, and send the 
> discarded event if it isn't:
> 
> if (discardedLoggingEvent != null && (!m_lossy || 
> (m_lossyEvaluator != null &&
> m_lossyEvaluator.IsTriggeringEvent(discardedLoggingEvent))))
> 
> Should I raise this as a bug?
> 
> Cheers,
> Richard.
> 
> --- Richard Gee <ri...@yahoo.com> wrote:
> > Hi,
> > 
> > I'm using the config example for the AdoNetAppender and it's losing 
> > the first log entry.
> > 
> > It's a very simple test - I log a count from 1 to 130 when 
> I press a button. 
> > Everything works fine, including the buffering of 100 records etc, 
> > except that it drops the first entry logged.
> > 
> > Adding a FileAppender confirms the missing entry is being 
> logged - it 
> > appears in the file no problem.
> > 
> > log4net v1.2.9
> > VB.Net 2003
> > .Net 1.1.4322 SP1
> > SQL Server 2000
> > Windows XP Pro
> > 
> > Cheers,
> > Richard.
> > 
> 
>