I looked at the unit tests. I'm using testng for the tests, so I'm trying to replicate the behavior of those rules by basically calling Configurator.shutdown(LoggerContext), but I think I have some trouble getting the right context to call it on.
On Tue, Jan 31, 2017 at 1:09 PM, Christopher Schultz < [email protected]> wrote: > Clément, > > On 1/31/17 1:17 PM, Clément Guillaume wrote: > > I have a unit test, using log4j 2.8 to log to a file using a > FileAppender, > > that deletes the log file at the end of the test. This test works well on > > linux, but fails on Windows because the java process still has a file > > handle to the log file, and so the file cannot be deleted. > > Any idea how to have the same behavior on the two platforms? > > What about shutting-down log4j (or the appender) before you try to > delete the file? > > -chris > >
