Forum Discussion

seldo's avatar
seldo
New Contributor
13 years ago

Log4j configuration with JUnit automation

I'm automating my SoapUI tests with JUnit, but I'm having strange difficulties when it comes to configuring Log4j.

I have created a log4j.xml file that specifies only a FileAppender (no console appender) and a global logging level of WARN. However, only _my_ logging statements go to my log file. All of the SoapUI log messages go to the console, and even DEBUG-level messages are logged.

It's almost as if SoapUI is reconfiguring log4j after my configuration is complete. Any ideas?

2 Replies

  • seldo's avatar
    seldo
    New Contributor
    I'm suspicious of DefaultSoapUICore.initLog() -- I think this method may be reconfiguring Log4j after the my application initially configures it.

    Edit: But therein lies the key -- by overriding the System property "soapui.log4j.config" to point to my log4j.xml, I can at least ensure that SoapUI's redundant, secondary initialization of log4j has no real effect.