I have a logger using java api, and in the unit test I set the output from the standard to my output and check if the messages are being printed(log, exceptions etc...) my code is
ByteArrayOutputStream mockedOutput = new ByteArrayOutputStream();
System.setOut(new PrintStream(mockedOutput));
System.setErr(new PrintStream(mockedOutput));
but the log is not being captured in the output, if I check the console(eclipse, or running through maven) the log is there meaning the is not going through my output. If replace the log for system.out.print then it works, I also can see exceptions and so on, only things that are being logged using java API is not being captured in the mockedOutput.
Does anyone have an idea?, I am running out of clue.