3

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

Tim Shi
  • 83
  • 6

2 Answers2

1

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

AlexWien
  • 28,470
  • 6
  • 53
  • 83
0

This is an interesting bit of information. Looking at the source code, the buffer size is, as you suggest, 8192 by default (http://docs.oracle.com/javase/6/docs/api/java/io/BufferedOutputStream.html). In Java 4, Javadoc indicated that it was 512. The information has disappeared from Javadoc in Java 6 and 7.

Afshin Moazami
  • 2,092
  • 5
  • 33
  • 55
Klaus
  • 2,328
  • 5
  • 41
  • 62