So I have logging working with my log4j.xml. The issue I have is, because ive moved over from .properties to .xml I need to add a few lines in to everything that has a logger.
Is there any way I can do the configuration without having to add these lines of code ? I tried moving the xml to the src folder and instead of giving me the warning bellow it logged nothing.
log4j:WARN No appenders could be found for logger (ProjectName).
log4j:WARN Please initialize the log4j system properly.
At the moment it works fine using the code above, but when I go to implement it in to my real application, it will take forever to add these 2 lines of code. I wondered if theres a way to have it configure the xml automatically?
The preferred way to specify the default initialization file is through the log4j.configuration system property.
It goes on to say that once you have specified "log4j.configuration=log4j.xml", you should put log4j.xml somewhere in the classpath, just as you formerly did with log4j.properties.
Hey Paul I understand this and I'm fine with that, my issue is I have to restart the server if I make changes to my log4j.xml. The only way I have found to work around it at the moment is to put this configuration in my code. I was wondering would something like log4jConfigListener, work and how would I implement this ? I'm currently not running log4j2 would this make a difference?