Quantcast

Lossy Value in SMTP Appender - Possible Bug?

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Lossy Value in SMTP Appender - Possible Bug?

Johnson, Cedrick

Hello-

 

My apologies, I’ve been trying to figure this out for the past few hours. We have an application that has the following log4net config:

  <root>

    <level value="INFO" />

    <appender-ref ref="RollingLogFileAppender" />

    <appender-ref ref="ConsoleAppender" />

    <appender-ref ref="SmtpAppender" />

  </root>

 

Pretty simple

 

In the SmtpAppender:

  <appender name="SmtpAppender" type="log4net.Appender.SmtpAppender">

    <to value="me" />

    <from value="someprocess" />

    <subject value="An error occured in some process" />

    <smtpHost value="ourmailserver" />

    <bufferSize value="1" />

    <lossy value="true" />

    <evaluator type="log4net.Core.LevelEvaluator">

      <threshold value="ERROR"/>

    </evaluator>

    <layout type="log4net.Layout.PatternLayout">

      <conversionPattern value="%date %property{MachineName} %property{UserName} [%thread] %-5level %logger - %message %newline" />

    </layout>

 

 

Generic. Yes, we have BufferSize set to 1, however, Development sent me a file with lossy=true. I understand how the lossy value works, but I am a little fuzzy on this particular situation, which I will describe below:

 

With Lossy set to ‘false’.. I got 18,000 emails (every INFO level message was in its own email) despite having the threshold value set to ‘ERROR’.

 

If I set lossy to true, I get the true ‘ERROR’ and above emails (and it’s not 18,000)

 

Perhaps I’m just utterly confused, but I don’t exactly see the correlation between lossy, buffersize and LevelEvaluator. Is this a potential bug given the situation described earlier?

 

Regards,

CJ

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Addendum: Lossy Value in SMTP Appender - Possible Bug?

Johnson, Cedrick

That should have read:

 

“Generic. Yes, we have BufferSize set to 1, however, Development sent me a file with lossy=FALSE. I understand how the lossy value works, but I am a little fuzzy on this particular situation, which I will describe below:”

 

My apologies for the mixup.

 

CJ

 


From: Johnson, Cedrick [mailto:[hidden email]]
Sent: Wednesday, December 12, 2007 8:37 PM
To: [hidden email]
Subject: Lossy Value in SMTP Appender - Possible Bug?

 

Hello-

 

My apologies, I’ve been trying to figure this out for the past few hours. We have an application that has the following log4net config:

  <root>

    <level value="INFO" />

    <appender-ref ref="RollingLogFileAppender" />

    <appender-ref ref="ConsoleAppender" />

    <appender-ref ref="SmtpAppender" />

  </root>

 

Pretty simple

 

In the SmtpAppender:

  <appender name="SmtpAppender" type="log4net.Appender.SmtpAppender">

    <to value="me" />

    <from value="someprocess" />

    <subject value="An error occured in some process" />

    <smtpHost value="ourmailserver" />

    <bufferSize value="1" />

    <lossy value="true" />

    <evaluator type="log4net.Core.LevelEvaluator">

      <threshold value="ERROR"/>

    </evaluator>

    <layout type="log4net.Layout.PatternLayout">

      <conversionPattern value="%date %property{MachineName} %property{UserName} [%thread] %-5level %logger - %message %newline" />

    </layout>

 

 

Generic. Yes, we have BufferSize set to 1, however, Development sent me a file with lossy=true. I understand how the lossy value works, but I am a little fuzzy on this particular situation, which I will describe below:

 

With Lossy set to ‘false’.. I got 18,000 emails (every INFO level message was in its own email) despite having the threshold value set to ‘ERROR’.

 

If I set lossy to true, I get the true ‘ERROR’ and above emails (and it’s not 18,000)

 

Perhaps I’m just utterly confused, but I don’t exactly see the correlation between lossy, buffersize and LevelEvaluator. Is this a potential bug given the situation described earlier?

 

Regards,

CJ

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Lossy Value in SMTP Appender - Possible Bug?

Ron Grabowski
In reply to this post by Johnson, Cedrick
When you use lossy=false in your configuration you get all the INFO messages because the threshold element in the evaluator is ignored. The evaluator is only active when lossy=true. When you combine this with a buffersize=1 the buffer is flushed after every message.

When you use lossy=true in your configuration messages are replaced when the buffer is full. You're only getting the most recent ERROR error because the buffer is set to 1...the last message is placed in the buffer then the buffer is flushed.

The lossy and evaluators settings make more sense when buffersize is greater than 1.

How are you wanting to receive your messages?

----- Original Message ----
From: "Johnson, Cedrick" <[hidden email]>
To: [hidden email]
Sent: Wednesday, December 12, 2007 8:37:08 PM
Subject: Lossy Value in SMTP Appender - Possible Bug?

Hello-

 

My apologies, I’ve been trying to figure this out for the past few hours. We have an application that has the following log4net config:

  <root>

    <level value="INFO" />

    <appender-ref ref="RollingLogFileAppender" />

    <appender-ref ref="ConsoleAppender" />

    <appender-ref ref="SmtpAppender" />

  </root>

 

Pretty simple

 

In the SmtpAppender:

  <appender name="SmtpAppender" type="log4net.Appender.SmtpAppender">

    <to value="me" />

    <from value="someprocess" />

    <subject value="An error occured in some process" />

    <smtpHost value="ourmailserver" />

    <bufferSize value="1" />

    <lossy value="true" />

    <evaluator type="log4net.Core.LevelEvaluator">

      <threshold value="ERROR"/>

    </evaluator>

    <layout type="log4net.Layout.PatternLayout">

      <conversionPattern value="%date %property{MachineName} %property{UserName} [%thread] %-5level %logger - %message %newline" />

    </layout>

 

 

Generic. Yes, we have BufferSize set to 1, however, Development sent me a file with lossy=true. I understand how the lossy value works, but I am a little fuzzy on this particular situation, which I will describe below:

 

With Lossy set to ‘false’.. I got 18,000 emails (every INFO level message was in its own email) despite having the threshold value set to ‘ERROR’.

 

If I set lossy to true, I get the true ‘ERROR’ and above emails (and it’s not 18,000)

 

Perhaps I’m just utterly confused, but I don’t exactly see the correlation between lossy, buffersize and LevelEvaluator. Is this a potential bug given the situation described earlier?

 

Regards,

CJ


Loading...