Search code examples
javaspringloggingstderrstandard-error

Why is Spring INFO logging to Standard Error?


I have a many DB integration tests that are using the following annotations for transactional rollback:

@RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration(locations={"classpath:ApplicationContext-DAOs.xml"})
@Transactional

The tests pass, but when I run them Spring deems it necessary to log at INFO level to standard error! It logs things like:

19/11/2010 16:49:11 org.springframework.test.context.TestContextManager
  retrieveTestExecutionListeners
INFO: @TestExecutionListeners is not present for class [class my.SomeDAOTest]:
  using defaults.
etc for many, many lines ...

Where do I turn this off?


Solution

  • You can hide it using log4j. In your log4j.xml, set a logger for spring to warn (or error).

    <logger name="org.springframework">
        <level value="warn"/>
    </logger>