Puzzled need help: Problem with logging API
Hi All,
I am initialising LogManager in my application and creating several loggers, depending upon my application module. I am unabled to print anything in the log files or the console. I am puzzled, 'cause I am doing the same thing in another application and it is working. I would really appreciate any help. Following is the breakdown of what I am doing:
I have the following entries in the logging properties file:
handlers=java.util.logging.FileHandler, java.util.logging.ConsoleHandler
java.util.logging.FileHandler.limit = 5000000
java.util.logging.ConsoleHandler.level = FINEST
java.util.logging.FileHandler.formatter = java.util.logging.SimpleFormatter
java.util.logging.ConsoleHandler.formatter = java.util.logging.SimpleFormatter
java.util.logging.FileHandler.pattern = crystal%u.log
java.util.logging.FileHandler.count = 10
java.util.logging.FileHandler.level = INFO
Following is the code snippet which initialize logging:
/*
m_logCfgFile points to the logging properties file
*/
System.setProperty("java.util.logging.config.file",m_logCfgFile.getAbsolutePath());
System.out.println("Reading log settings from "+m_logCfgFile.getAbsolutePath());
LogManager logManager = LogManager.getLogManager();
logManager.readConfiguration();
Logger.getLogger("").info("Logging initialized");
/*
the first log message "Logging initialized" is printed on the console, however nothing subsequently is printed.
*/

