vy commented on PR #1471: URL: https://github.com/apache/logging-log4j2/pull/1471#issuecomment-1554776787
> I really don't care for this solution. It presupposes that all one wants to do is log events to a list. The vast majority of our tests that need to run in parallel do not do this. Indeed it doesn't solve the problem in _our [Log4j] tests_, yet it solves dozens in my company. Hence, there are other use cases out there. That said, indeed solving it for all of them is better, if possible. > You are on the right track with storing the LoggerContext's in the environment but instead what should be implemented is a LoggerContextSelector that retrieve the correct logger context from the environment. The obvious choice would be to use the test class name as the key for the LoggerContext. Imagine I have two `should_jump()` and `should_crawl()` tests in a single test class and they verify the behaviour of logging component `Foo`. Each test method ideally should have its own `LoggerContext`. Though once `static final Logger LOGGER` field of `Foo` is initialized, it will trigger a single `LoggerContext` creation. Second, will this of `should_jump()` or `should_crawl()`? (Assume I want to run these tests in parallel.) In a nutshell, I am not able to see how to detach `LoggerContext`s of two different test methods. Any ideas? -- 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]
