Log4j.xml in client banks

I have some jar files that will be distributed among clients that use log4j for logging. My question is whether to include the log4j.xml configuration in a jar file or provide a client if they want to log?

My feeling is to leave the client jars log4j.xml out configuration file since the apar jar files all have log4j logging but sans log4j.xml.

+5
source share
5 answers

Yes, leave it. This is extremely frustrating when your log4j configuration file is ignored because one of the 60 third-party libraries in your application contains its own.

+9
source

The good thing about log4j in your case is that your bank really should not worry about it. The main use case for log4j is:

  • Get log object for current class
  • Call one of the methods of this logger, for example debug("some message");

, , , , . , log4j . , log4j.

, , , log4j unit test setUp() - , , .

+5

log4j , , . , , ( , ). , , log4j, , , , .

+2

log4j , . , ? , A log4j 1.2, B log4j 1.3.

, , , .

0

xml , . , , .

0

All Articles