[prev in list] [next in list] [prev in thread] [next in thread] 

List:       logback-user
Subject:    Re: [logback-user] not logging every message even with discardingThreshold set to 0
From:       David Roussel <nabble () diroussel ! xsmail ! com>
Date:       2016-05-06 20:26:08
Message-ID: 7701011E-DB81-4B8D-8550-C199669F75E4 () diroussel ! xsmail ! com
[Download RAW message or body]

[Attachment #2 (multipart/alternative)]


Hi,

The AsyncAppender is not very complex. You can inspect the code to see how it works. \
As you can see that code will get very congested with 200 threads contending for one \
lock. 

I would suggest using less threads. Using s non blocking web server. Or using log4j \
2.0 with it's disruptor based async logging. 

David

> On 6 May 2016, at 19:59, Marcus Chen <marcus.chen@dev9.com> wrote:
> 
> Hi,
> We have a SpringBoot app that uses Logback. It uses Async appender and configured \
> as this: <appender name="ASYNC" class="ch.qos.logback.classic.AsyncAppender">
> <queueSize>10000</queueSize>
> <discardingThreshold>0</discardingThreshold>
> <appender-ref ref="FILE" />
> </appender>
> 
> <root level="INFO">
> <appender-ref ref="ASYNC" />
> </root>
> The app (single instance) is configured to have up to 200 Jetty threads. Throughput \
> is around 50 POSTs/sec. I find there are 2-4 minute gaps in messages logged after \
> 30 minutes. The gaps appear every 20 to 30 minutes. Am I missing additional \
> configurations? Also is Async appender the best way to go if logging fidelity is of \
> high importance? If not what is the best configuration so not to lose any messages. \
> Thanks in advance. ________________________________________________________
> MARCUS CHEN – Senior Developer, AWS Certified Developer Associate
> marcus.chen@dev9.com | dev9.com
> Custom Software. Continuous Delivery.
> 
> _______________________________________________
> logback-user mailing list
> logback-user@qos.ch
> http://mailman.qos.ch/mailman/listinfo/logback-user


[Attachment #5 (text/html)]

<html><head><meta http-equiv="content-type" content="text/html; \
charset=utf-8"></head><body dir="auto"><div>Hi,</div><div \
id="AppleMailSignature"><br></div><div id="AppleMailSignature">The AsyncAppender is \
not very complex. You can inspect the code to see how it works. As you can see that \
code will get very congested with 200 threads contending for one \
lock.&nbsp;</div><div id="AppleMailSignature"><br></div><div \
id="AppleMailSignature">I would suggest using less threads. Using s non blocking web \
server. Or using log4j 2.0 with it's disruptor based async \
logging.&nbsp;<br><br>David</div><div><br>On 6 May 2016, at 19:59, Marcus Chen &lt;<a \
href="mailto:marcus.chen@dev9.com">marcus.chen@dev9.com</a>&gt; \
wrote:<br><br></div><blockquote type="cite"><div>

<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">


<div style="font-size: 14px;">Hi,</div>
<div style="font-size: 14px;">We have a SpringBoot app that uses Logback. It uses \
Async appender and configured as this:</div> <div>
<pre style="background-color: rgb(255, 255, 255); font-family: Menlo;"><span \
style="font-size: 12px;"><span style="background-color: rgb(239, 239, \
239);">&lt;</span><span style="color: rgb(0, 0, 128); background-color: rgb(239, 239, \
239); font-weight: bold;">appender </span><span style="color: rgb(0, 0, 255); \
background-color: rgb(239, 239, 239); font-weight: bold;">name</span><span \
style="color: rgb(0, 128, 0); background-color: rgb(239, 239, 239); font-weight: \
bold;">="ASYNC" </span><span style="color: rgb(0, 0, 255); background-color: rgb(239, \
239, 239); font-weight: bold;">class</span><span style="color: rgb(0, 128, 0); \
background-color: rgb(239, 239, 239); font-weight: \
bold;">="ch.qos.logback.classic.AsyncAppender"</span><span style="background-color: \
rgb(239, 239, 239);">&gt;</span><br>    <span style="background-color: rgb(239, 239, \
239);">&lt;</span><span style="color: rgb(0, 0, 128); background-color: rgb(239, 239, \
239); font-weight: bold;">queueSize</span><span style="background-color: rgb(239, \
239, 239);">&gt;</span>10000<span style="background-color: rgb(239, 239, \
239);">&lt;/</span><span style="color: rgb(0, 0, 128); background-color: rgb(239, \
239, 239); font-weight: bold;">queueSize</span><span style="background-color: \
rgb(239, 239, 239);">&gt;</span><br>    <span style="background-color: rgb(239, 239, \
239);">&lt;</span><span style="color: rgb(0, 0, 128); background-color: rgb(239, 239, \
239); font-weight: bold;">discardingThreshold</span><span style="background-color: \
rgb(239, 239, 239);">&gt;</span>0<span style="background-color: rgb(239, 239, \
239);">&lt;/</span><span style="color: rgb(0, 0, 128); background-color: rgb(239, \
239, 239); font-weight: bold;">discardingThreshold</span><span \
style="background-color: rgb(239, 239, 239);">&gt;</span><br>    <span \
style="background-color: rgb(239, 239, 239);">&lt;</span><span style="color: rgb(0, \
0, 128); background-color: rgb(239, 239, 239); font-weight: bold;">appender-ref \
</span><span style="color: rgb(0, 0, 255); background-color: rgb(239, 239, 239); \
font-weight: bold;">ref</span><span style="color: rgb(0, 128, 0); background-color: \
rgb(239, 239, 239); font-weight: bold;">="FILE" </span><span style="background-color: \
rgb(239, 239, 239);">/&gt;</span><br><span style="background-color: rgb(239, 239, \
239);">&lt;/</span><span style="color: rgb(0, 0, 128); background-color: rgb(239, \
239, 239); font-weight: bold;">appender</span><span style="background-color: rgb(239, \
239, 239);">&gt;</span><br><br><span style="background-color: rgb(239, 239, \
239);">&lt;</span><span style="color: rgb(0, 0, 128); background-color: rgb(239, 239, \
239); font-weight: bold;">root </span><span style="color: rgb(0, 0, 255); \
background-color: rgb(239, 239, 239); font-weight: bold;">level</span><span \
style="color: rgb(0, 128, 0); background-color: rgb(239, 239, 239); font-weight: \
bold;">="INFO"</span><span style="background-color: rgb(239, 239, \
239);">&gt;</span><br>    <span style="background-color: rgb(239, 239, \
239);">&lt;</span><span style="color: rgb(0, 0, 128); background-color: rgb(239, 239, \
239); font-weight: bold;">appender-ref </span><span style="color: rgb(0, 0, 255); \
background-color: rgb(239, 239, 239); font-weight: bold;">ref</span><span \
style="color: rgb(0, 128, 0); background-color: rgb(239, 239, 239); font-weight: \
bold;">="ASYNC" </span><span style="background-color: rgb(239, 239, \
239);">/&gt;</span><br><span style="background-color: rgb(239, 239, \
239);">&lt;/</span><span style="color: rgb(0, 0, 128); background-color: rgb(239, \
239, 239); font-weight: bold;">root</span><span style="background-color: rgb(239, \
239, 239);">&gt;</span></span><span style="font-size: 12pt;"><br></span></pre> </div>
<div style="font-size: 14px;">
<div>
<div style="font-size: 15px; margin: 0px;">The app (single instance) is configured to \
have up to 200 Jetty threads. Throughput is around 50 POSTs/sec. I find there are 2-4 \
minute gaps in messages logged after 30 minutes. The gaps appear every 20 to 30 \
minutes.  Am I missing additional configurations? Also is Async appender the best way \
to go if logging fidelity is of high importance? If not what is the best \
configuration so not to lose any messages. Thanks in advance.</div> <div \
style="font-size: 15px; margin: 0px;"><font style="font-size: 11pt;"><b><font \
face="Calibri" color="#3038f7" style="background-color: rgb(255, 254, \
254);">____________________________________________________</font></b></font><b><font \
face="Calibri" color="#3038f7" style="background-color: rgb(255, 254, \
254);">___</font></b><b><font face="Calibri" color="#3038f7" style="background-color: \
rgb(255, 254, 254);">_</font></b></div> <div style="background-color: rgb(255, 255, \
255); margin: 0px;"><b><font face="Calibri" color="#0433ff"><span style="font-size: \
15px;">MARCUS CHEN</span></font>&nbsp;–&nbsp;Senior Developer, AWS Certified \
Developer Associate</b></div> <p style="margin-top: 0px; margin-bottom: 0px; \
background-color: rgb(255, 255, 255);"> </p>
<div style="background-color: rgb(255, 255, 255); margin: 0px;"><font \
style="font-family: Calibri; font-size: 11pt;" color="#0433ff"><span \
style="font-size: 14px;"><a \
href="mailto:marcus.chen@dev9.com">marcus.chen@dev9.com</a></span><a \
href="mailto:marcus.chen@dev9.com">&nbsp;</a></font><font style="font-family: \
Calibri; font-size: 11pt;">|</font><font style="color: rgb(33, 33, 33); font-family: \
Calibri; font-size: 11pt;">&nbsp;<a href="http://dev9.com">dev9.com</a></font></div> \
<div style="color: rgb(33, 33, 33); background-color: rgb(255, 255, 255); margin: \
0px;"> <font style="font-size: 11pt;"><font color="#636466" face="Calibri">Custom \
Software.&nbsp;Continuous Delivery.</font></font></div> </div>
<br>
</div>


</div></blockquote><blockquote \
type="cite"><div><span>_______________________________________________</span><br><span>logback-user \
mailing list</span><br><span><a \
href="mailto:logback-user@qos.ch">logback-user@qos.ch</a></span><br><span><a \
href="http://mailman.qos.ch/mailman/listinfo/logback-user">http://mailman.qos.ch/mailman/listinfo/logback-user</a></span></div></blockquote></body></html>



[Attachment #6 (text/plain)]

_______________________________________________
logback-user mailing list
logback-user@qos.ch
http://mailman.qos.ch/mailman/listinfo/logback-user

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic