Skip to content

Conversation

@dimitarndimitrov
Copy link

The docs for the AsyncLoggerConfig properties, which are relevant for mixed sync and async loggers, specify the wrong property name for the config that controls the Disruptor ring buffer size. Interestingly the right property name is used in the anchor ID linking to the exact section in the docs, but if you copy the property name from the docs themselves (like me), you are gonna have a bad time.

I found this after noticing a too big ring buffer in a heap dump, and ended up chasing it with the StatusLogger debug logging and the log line in AsyncLoggerConfigDisruptor.start dumping the configured size. The small fix was also verified this way.

In hindsight, this should have been obvious, but it really wasn't (for me).

Checklist

  • Base your changes on 2.x branch if you are targeting Log4j 2; use main otherwise
  • ./mvnw verify succeeds (the build instructions)
  • Non-trivial changes contain an entry file in the src/changelog/.2.x.x directory
  • Tests are provided

The docs for the AsyncLoggerConfig properties, which are relevant for mixed
sync and async loggers, specify the wrong property name for the config that
controls the Disruptor ring buffer size. Interestingly the right property
name is used in the anchor ID linking to the exact section in the docs,
but if you copy the property name from the docs themselves (like me), you
are gonna have a bad time.

I found this after noticing a too big ring buffer in a heap dump, and ended up
chasing it with the StatusLogger debug logging and the log line in
AsyncLoggerConfigDisruptor.start dumping the configured size. The small fix was
also verified this way.

In hindsight, this should have been obvious, but it really wasn't (for me).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Development

Successfully merging this pull request may close these issues.

1 participant