[logback-user] Looking for details about AsyncAppender properties

KARR, DAVID dk068x at att.com
Sat May 22 18:11:08 CEST 2021


I should have mentioned that I’ve already read that page, and multiple times.

My question about “queueSize” is specific to memory allocation.  I understand the blocking behavior.  When I saw that the default value was 256, and my team was proposing a value of 100000, I wanted to be sure that didn’t have any unexpected consequences, like if that number represents the relative size of a pre-allocated buffer, that would be unexpected.  I think this is unlikely, but the documentation doesn’t say anything about this.

Concerning “includeCallerData”, so it consists of the file and line of the caller. I see in the documentation for PatternLayout. I assume this is potentially the only way that information would be utilized?

From: logback-user <logback-user-bounces at qos.ch> On Behalf Of David Roussel
Sent: Saturday, May 22, 2021 12:07 AM
To: logback users list <logback-user at qos.ch>
Subject: Re: [logback-user] Looking for details about AsyncAppender properties

Hi David,

As documented in http://logback.qos.ch/manual/appenders.html<https://urldefense.com/v3/__http:/logback.qos.ch/manual/appenders.html__;!!BhdT!07aKoZX2Fw7v5BkqgjGU20O5MKOiqa0FwqVQttt4o3lHAOG49nbJiefncP1bJg$>

The queue in async appender is a blocking queue. So if it fills up, then the application code will block until there is space in the queue.

Burg that blocking will only occur for error messages as mentioned in the above linked page;

> Note that by default,AsyncAppender will drop events of level TRACE, DEBUG and INFO if its queue is 80% full. This strategy has an amazingly favorable effect on performance at the cost of event loss.

So this is a reason to use a large queue size, if you want to avoid loosing info messages under high load.

As for ‘ includeCallerData’, this including information about the caller of the logger, like line number and file. This takes us more memory, and not all for matters use it.
David


On 22 May 2021, at 04:21, KARR, DAVID <dk068x at att.com<mailto:dk068x at att.com>> wrote:
I'm investigating what the consequences will be of changing some of our high volume logging calls to use an AsyncAppender instead of a synchronous appender.  Our services run in a k8s container, so they are ultimately writing to stdout, although other processes are aggregating that log output to Splunk or ELK.

I understand the basic idea of what the AsyncAppender will do, but I have some questions about the impact of some property settings which I cannot find details about in the documentation.

I'm mostly interested in the "queueSize" and "includeCallerData" properties.

Concerning "queueSize", I know it is the limit to the size of the input queue, but how exactly is that parameter utilized?  Is any memory allocated based on that queue size at startup, or is it simply the limit of a dynamically expanding list?  The default queue size is apparently 256.  A team in our organization is planning to set this to a very large number, like 100000.  Obviously, there would be considerable impact if the queue really reached that size, and I understand that.

Concerning "includeCallerData", I understand this even less.  How is this "caller data" used?  What does it really represent? What is the impact of this being included or not included?  I tried running tests with one service with the main high volume appender being set to use the sync appender, and then the async appender.  I didn't really notice any changes in the output.
_______________________________________________
logback-user mailing list
logback-user at qos.ch<mailto:logback-user at qos.ch>
http://mailman.qos.ch/mailman/listinfo/logback-user<https://urldefense.com/v3/__http:/mailman.qos.ch/mailman/listinfo/logback-user__;!!BhdT!07aKoZX2Fw7v5BkqgjGU20O5MKOiqa0FwqVQttt4o3lHAOG49nbJiecNrKH5WA$>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.qos.ch/pipermail/logback-user/attachments/20210522/215dd211/attachment.html>


More information about the logback-user mailing list