Monday, September 17, 2007

JAVA: How to stop the logger from displaying the error messages in the console window

Use setUseParentHandlers(false);

if (LOG)
{
try
{
// Send logger output to our FileHandler.
fh = new FileHandler("logs/" + port + ".xml", 100000, 5, true);
logger.setUseParentHandlers(false); // HERE!!!!!
logger.addHandler(fh);
// Request that every detail gets logged.
logger.setLevel(Level.ALL);
}
catch (IOException e)
{
System.err.println ("Unable to create log file");
}
}

Labels: , , ,


Comments: Post a Comment



<< Home

This page is powered by Blogger. Isn't yours?