Re: Unit testing custom log event factory fails intermittently
Travis Spencer <[email protected]>
| Newsgroups | gmane.comp.jakarta.log4j.user |
|---|---|
| Message-ID | <CAEKOcs0o7jDFSfTx-qQLtWKYF-=f0AjCOWqqfMgB1uACON=q0g@mail.gmail.com> |
On Thu, Sep 30, 2021 at 9:29 AM Travis Spencer <[email protected]> wrote: > 2. Is there some other way to set the LogEventFactory besides a system > property? I did like this: @BeforeClass public static void beforeClass() { _context.getConfiguration().getLoggers() .forEach((loggerName, loggerConfig) -> loggerConfig.setLogEventFactory( new MyGoodLogEventFactory())); } @ClassRule public static LoggerContextRule _context = new LoggerContextRule("myGoodConfig.xml"); Tests pass fine now.