Java – I should put log4j Do you want to put the properties file into the library?

I have a library project This project uses log4j for logging

I should put log4j Properties into the generated jar? If this is not a good habit, can you tell me why?

Solution

You should set log4j Properties are placed outside the jar file because it is easier to modify it If the application does not force a reload of the configuration (you can do this), a simple restart will load the configuration (modifying it in a jar file usually means rebuilding) If the application does know how to reload it, your changes are applied almost immediately This is important when you have an application in a production environment, and you want to change logging settings (such as logging level) for more information, but don't stop the application (or worse, rebuild it) for this

The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
分享
二维码
< <上一篇
下一篇>>