posted 19 years ago
Hi,
I am using java.util.logging.Logger class to log error messages to a file.
All the error messages are directed to a .log file properly. But, the same error messages are even appearing on a console. I want to avoid this. I appriciate anyone's help on this:
Below is the code:
try
{
logger= Logger.getLogger("org.mirapoint.LogMonitor");
logToFile=new FileHandler("LogMonitor_erros.log");
logToFile.setFormatter(new SimpleFormatter());
logger.setLevel(Level.SEVERE);
logger.addHandler(logToFile);
Properties prop = new Properties();
prop.load(new FileInputStream("monitor.properties"));
}
catch(FileNotFoundException fnf)
{
logger.log(Level.SEVERE," The Exception is :",fnf);
}