Re: [D] Help with migrating from log4j to log4j2 (we also use a slf4j -> log4j) [logging-log4j2]
paladox (via GitHub) <[email protected]>
| Newsgroups | gmane.comp.jakarta.log4j.devel |
|---|---|
| Message-ID | <ghd-D_kwDOAKJSSM4AhuMF-b260f8c8-6c6c-427b-9324-bd7470130483__10216.4462603227$1757251130$gmane$org@gitbox.apache.org> |
GitHub user paladox edited a comment on the discussion: Help with migrating from log4j to log4j2 (we also use a slf4j -> log4j)
I found another alternative:
```
LoggerContext ctx = (LoggerContext) LogManager.getContext(false);
ctx.addPropertyChangeListener(
evt -> {
if ("config".equals(evt.getPropertyName())) {
synchronized (lock) {
if (async == null || !async.isStarted()) {
enableLogging();
}
}
}
});
```
Seems the problem happens to all classes that use AsyncAppender and when you call reconfigure it stops it for all. So the above changes would have to happen in all the classes. But is there an alternative? Am I doing things wrong?
GitHub link: https://github.com/apache/logging-log4j2/discussions/3914#discussioncomment-14331488
----
This is an automatically sent email for [email protected].
To unsubscribe, please send an email to: [email protected]