You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@maven.apache.org by "Francesco Chicchiriccò (JIRA)" <ji...@apache.org> on 2016/08/10 09:35:20 UTC

[jira] [Comment Edited] (SUREFIRE-1268) With JUnit listener, redirectTestOutputToFile is ignored

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

Francesco Chicchiriccò edited comment on SUREFIRE-1268 at 8/10/16 9:34 AM:
---------------------------------------------------------------------------

Also noticed that {{target/surefire-reports/null-output.txt}} is created.

I have currently switched, in {{log4j2.xml}}, from 

{code}
    <console name="main" target="SYSTEM_OUT">
      <PatternLayout>
        <pattern>%d{HH:mm:ss.SSS} %-5level %logger - %msg%n</pattern>
      </PatternLayout>
    </console>
{code}

to

{code}
    <RollingRandomAccessFile name="main" fileName="${log.directory}/offline-tests.log"
                             filePattern="${log.directory}/core-%d{yyyy-MM-dd}.log.gz"
                             immediateFlush="false" append="true">
      <PatternLayout>
        <pattern>%d{HH:mm:ss.SSS} %-5level %logger - %msg%n</pattern>
      </PatternLayout>
      <Policies>
        <TimeBasedTriggeringPolicy/>
        <SizeBasedTriggeringPolicy size="250 MB"/>
      </Policies>
    </RollingRandomAccessFile>
{code}

to keep my console output clean.


was (Author: ilgrosso):
Also noticed that {{target/surefire-reports/null-output.txt}} is created.

I have currently switched, in {{log4j2.xml},} from 

{code}
    <console name="main" target="SYSTEM_OUT">
      <PatternLayout>
        <pattern>%d{HH:mm:ss.SSS} %-5level %logger - %msg%n</pattern>
      </PatternLayout>
    </console>
{code}

to

{code}
    <RollingRandomAccessFile name="main" fileName="${log.directory}/offline-tests.log"
                             filePattern="${log.directory}/core-%d{yyyy-MM-dd}.log.gz"
                             immediateFlush="false" append="true">
      <PatternLayout>
        <pattern>%d{HH:mm:ss.SSS} %-5level %logger - %msg%n</pattern>
      </PatternLayout>
      <Policies>
        <TimeBasedTriggeringPolicy/>
        <SizeBasedTriggeringPolicy size="250 MB"/>
      </Policies>
    </RollingRandomAccessFile>
{code}

to keep my console output clean.

> 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ò
>
> 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)