[ 
https://issues.apache.org/jira/browse/SUREFIRE-1268?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15449690#comment-15449690
 ] 

Tibor Digana commented on SUREFIRE-1268:
----------------------------------------

I see now. The problem is that the listeners are instantiated first in Surefire 
and the stream System.out gets replaced after that. Most probably LOG4J handles 
the original System.out when the static class context was called.
I should reorder listener and call of setOut() in providers.

> With JUnit listener, redirectTestOutputToFile is ignored
> --------------------------------------------------------
>
>                 Key: SUREFIRE-1268
>                 URL: https://issues.apache.org/jira/browse/SUREFIRE-1268
>             Project: Maven Surefire
>          Issue Type: Bug
>          Components: Junit 4.x support, Maven Surefire Plugin
>    Affects Versions: 2.19.1
>         Environment: Linux
>            Reporter: Francesco Chicchiriccò
>            Assignee: Tibor Digana
>
> When specifying, according to [this 
> doc|http://maven.apache.org/surefire/maven-surefire-plugin/examples/junit.html#Using_Custom_Listeners_and_Reporters],
>  a JUnit listener, the test output is sent to STDOUT, even though 
> {{redirectTestOutputToFile}} is set to {{true}}.
> This happens with log4j2 configuration for {{SYSTEM_OUT}}, regular 
> {{System.out.println}} works fine.
> With no {{properties}} element, {{redirectTestOutputToFile}} is honored.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to