Jimisola,

FWIW, our team developed a small set of abstract test support classes that
extend Junit TestCase. The base class of this set of classes is
LoggingTestCase which configures log4j from a non-default "
test-log4j.properties" file in the same package as the test case. Such a
setup handles #2 and #3 quite nicely without any conflict with #1.

HTH,
Doug

On 6/10/06, Jimisola Laursen <[EMAIL PROTECTED]> wrote:


Hi!

I've seen various posts on log4j and Maven, but I haven't seen any answer
to
what I want to do. I want to be able to use different settings for log4j
for:

1. main (releases using mvn assembly)
2. tests (unit tests)
3. development (when running/debugging the program within Eclipse or
outside with more extra logging)

I know that I should place log4j.properties under main/resources and
test/resources. This will hopefully solve 1) and 2) . However,  I read
something about Maven giving precedence to main/resources instead of
test/resources - is that still the case?

I would like to avoid a long line of system properties on the command line
since they're easy to forget and especially for new develepors to get. I'd
then prefer to just add one "environment" property (main, test,
development)
which can then be used throughout our Maven environment in case we have
similiar situations.

Any ideas?

Regards,
Jimisola
--
View this message in context:
http://www.nabble.com/How-to-setup-log4j-with-different-settings-for-main%2C-test-and-developmen-t1766805.html#a4808936
Sent from the Maven - Users forum at Nabble.com.


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


Reply via email to