vy commented on issue #2966:
URL: 
https://github.com/apache/logging-log4j2/issues/2966#issuecomment-2360365649

   @chandrabol, allow me to share some more findings:
   
   ### The `packages` attribute
   [`sentry-log4j2` (sadly) recommends using the `packages` 
attribute.](https://docs.sentry.io/platforms/java/guides/log4j2/#configure) 
Though [`sentry-log4j2:7.14.0` is compiled using Log4j 
`2.20.0`](https://github.com/getsentry/sentry-java/blob/main/buildSrc/src/main/java/Config.kt#L72),
 and hence, contains a Log4j plugin descriptor which removes the need to 
`packages` attribute. Hence, you can safely remove `packages` attribute from 
your `log4j2.xml` and it should all be fine.
   
   ### Asynchronous loggers
   
   I see you're using asynchronous loggers. `sentry-log4j2` docs explicitly 
state the following:
   
   > `SentryAppender` does not support Log4j2's [async 
mode](https://logging.apache.org/log4j/2.x/manual/async.html). The Sentry Java 
SDK itself is already asynchronous and does not perform any blocking operation 
on the calling thread.
   
   Log4j asynchronous logging is opt-in. That is, you must have extra 
configuration somewhere (including `AsyncLogger` and `AsyncRoot` elements in 
your `pom.xml`) to enable it. I advise you to remove all these extras. If 
performance happens to become a problem, you can [configure Log4j in 
mixed-mode](https://logging.apache.org/log4j/2.x/manual/async.html#MixedSync-Async)
 – though I strongly advise you to avoid optimizing, unless you need to.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to