You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@logging.apache.org by Volkan Yazıcı <vo...@gmail.com> on 2019/04/23 06:49:28 UTC

How to write to a ByteBufferDestination

Hello,

In log4j2-logstash-layout <https://github.com/vy/log4j2-logstash-layout>, I
am trying to fix a concurrency bug which led me investigate the way I write
to a ByteBufferDestination.
ByteBufferDestinationHelper.writeToUnsynchronized() provides a helper to
serve this purpose, though I am a little bit confused on how to use it.
What is the recommended way to call it? By first synchronize'ing on the
destination and then calling the function? Are there any alternatives?
Would anybody mind giving some further details (preferably with some
examples), please?

Best.