You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The site and assembly targets in log4j output hundreds of lines of detailed JUnit test progress and results.
[...]
[junit] Testcase: testBadTabbing took 0 sec
[junit] Testcase: testHeaderLogging took 0.003 sec
[junit] Testcase: testLayoutHeader took 0.003 sec
[junit] Testcase: testBigPackets took 0 sec
[junit] Testcase: testTwoParamConstructor took 0 sec
[junit] Testcase: testTwoParamConstructorBadFacility took 0 sec
[junit] Testcase: testThreeParamConstructor took 0.002 sec
[junit] Testcase: testGetFacilityString took 0 sec
[junit] Testcase: testGetFacilityStringUnexpected took 0 sec
[junit] Testcase: testGetFacilityBogus took 0 sec
[...]
Seems especially gross that, it looks like, unit tests that check that log4j throws exceptions in certain cases output those expected-exception stack traces.
[...]
[junit] log4j: Setting property [reconnectionDelay] to [0].
[junit] log4j: FB: The following error reported: Could not connect to remote log4j server at [localhost]. We are not retrying.
[junit] java.net.ConnectException: Connection refused (Connection refused)
[junit] at java.net.PlainSocketImpl.socketConnect(Native Method)
[junit] at java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:350)
[junit] at java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:206)
[junit] at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:188)
[junit] at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:392)
[junit] at java.net.Socket.connect(Socket.java:607)
[junit] at java.net.Socket.connect(Socket.java:556)
[junit] at java.net.Socket.<init>(Socket.java:452)
[junit] at java.net.Socket.<init>(Socket.java:262)
[junit] at org.apache.log4j.net.SocketAppender.connect(SocketAppender.java:204)
[junit] at org.apache.log4j.net.SocketAppender.activateOptions(SocketAppender.java:161)
[junit] at org.apache.log4j.config.PropertySetter.activate(PropertySetter.java:257)
[junit] at org.apache.log4j.xml.DOMConfigurator.parseAppender(DOMConfigurator.java:285)
[...]
I'd rather not see that unless I explicitly ask for it. See if there's a way to turn all that off. Only output failures and errors by default.
The text was updated successfully, but these errors were encountered:
apjanke
changed the title
Make junit tests quiet in normal build targets in log4j
Make junit tests quiet in normal build targets in log4j 1.2
Sep 15, 2022
Oh, you know what? Looks like this output was not from the Maven surefire plugin, but from the antrun plugin running the ant JUnit test. So it's not under the direct control of the pom.xml; it's controlled by build.xml; that's probably why my attempts to quiet surefire didn't work. I turned off the antrun junit tests in #21, and all this output disappeared. :)
And, haha, guess what? In pom.xml's <build><plugins><plugin><configuration> for maven-surefire-plugin, there's a <skip>true</skip>, which means surefire isn't running any tests at all. I removed that <skip>true</skip>, and surefire went to running tests, and there were several failures. I guess that's why log4j is calling out to ant for its unit testing? I put the <skip>true</skip> back in, because I just want to get it building first.
The
site
andassembly
targets in log4j output hundreds of lines of detailed JUnit test progress and results.Seems especially gross that, it looks like, unit tests that check that log4j throws exceptions in certain cases output those expected-exception stack traces.
I'd rather not see that unless I explicitly ask for it. See if there's a way to turn all that off. Only output failures and errors by default.
The text was updated successfully, but these errors were encountered: