Use two separate file appenders, each pointing to its own file (eg.... application.log and junit.log). Then, I recommend that you define stuff in the <root> logger that you'd want for your most common logging activities; probably the stuff going to application.log. After that, define a logger for your junit tests. Provide a reference to the junit appender, give it a level, and set additivity to "false" such as...


<logger name="test.com.mycompany.mypackage" additivity="false"><level value="debug"/><appender-ref ref="JUnitAppender"/></logger>

That will end up acting, essentially, as the <root> logger for your junit tests and you will have entirely separated logging for application and junit classes.

Jake


At 08:00 PM 11/5/2003 -0600, you wrote:
1. how can the same log output be sent to two syslogs and a file?

2. I am running JUnit and my Application.  They both use log4j
        Just running the application, all is logged in the
        expected file.

        When running tests, via JUnit, the JUnit test output
        ends up in the Application logs.

        How can this be separated to go to 2 diff files at
        test time?
--
=================================================================
= Management is doing things right; leadership is doing the     =
=       right things.    - Peter Drucker                        =
=_______________________________________________________________=
=     http://www.sun.com/service/sunps/jdc/javacenter.pdf       =
=  www.sun.com | www.javasoft.com | http://www.sun.com/sunone   =
=================================================================


--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to