Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to change the underlying buffer size of BufferedOutputStream used by logback's FileAppender?

We are using logback as our logging framework. We noticed that the FileAppender uses ResilientFileOutputStream which is backed by an BufferedOutputStream. We are wondering if there's a way to configure the buffer size of this BufferedOutputStream instance so that we can tune the performance of logback.

Thanks

like image 724
Tim Shi Avatar asked Jan 16 '26 20:01

Tim Shi


1 Answers

As i remeber, BufferedOutputStream uses a buf size of 8192 per default. I remember an perfomrance examination paper, where they showed that 8192 is the most performant. It does not make sense to raise the size of more than 8192

like image 124
AlexWien Avatar answered Jan 19 '26 11:01

AlexWien



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!