• Post Reply Bookmark Topic Watch Topic
  • New Topic

How To: log4j property file outside of EAR/WAR  RSS feed

 
Ron Alby
Greenhorn
Posts: 27
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
After a brief struggle I found where to put the log4j property file in my WAR so that my WebService could find it.

However, and advantage to having a property file is being able to change the logging levels on the fly without any recompiling - reassembling - redeploying. By sticking the property file in the WAR I have lost that advantage.

What is the best practice to having the log4j properties defined for a J2EE app in such a way that they can be changed on the fly?


Thanks
Ron
 
Nam Ha Minh
Ranch Hand
Posts: 512
Eclipse IDE Firefox Browser Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Why not use:


 
Ron Alby
Greenhorn
Posts: 27
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I considered that .. and considered setting the log4j.configuration system property. I didn't know if this was an appropriate approach in an app server (possibly clustered) environment or not - given all the prohibitions against file I/O. I wasn't sure if people were putting it in the DB or something.

Thanks
Ron
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!