I am pretty new to java logging mechanisms, and I am now trying to use apache commons logging for my project. It's a Java EE project and the EAR file is deployed to WebLogic server. Basically, I want to use java.util.logging implementation, and I have commons-logging.properties file defined as below
handlers = java.util.logging.ConsoleHandler, java.util.logging.FileHandler
java.util.logging.FileHandler.pattern = testLog.log
java.util.logging.FileHandler.limit = 50000
java.util.logging.FileHandler.count = 1
java.util.logging.FileHandler.formatter = java.util.logging.XMLFormatter
java.util.logging.FileHandler.level=SEVERE
java.util.logging.ConsoleHandler.level=SEVERE
java.util.logging.ConsoleHandler.formatter = java.util.logging.SimpleFormatter
For the packaging, I've put commons-logging.properties file to the lib directory of my EAR file. However, all my loggin output is printed toconsole instead of the log file specified in the configuration. Could anyone provide any suggestion or did I miss out anything in my configuration?
java.util.logging
vs SLF4J. – Buhake Sindi Nov 15 '11 at 8:25