I wrote a custom logger where the only addition is the following method:
public static synchronized Logger getLogger(String name) {
try {
boolean append = true;
FileHandler handler = new FileHandler("tmp.log", append);
Logger log = Logger.getLogger(name);
log.addHandler(handler);
return log;
} catch (java.io.IOException ex) {
//Logger.getLogger(LibraLogger.class.getName()).log(Level.SEVERE, null, ex);
} catch (SecurityException ex) {
//Logger.getLogger(LibraLogger.class.getName()).log(Level.SEVERE, null, ex);
}
return Logger.getLogger(name);
}
It produces a series of log files tmp.log, tmp.log.1, tmp.log.2 etc.
How do I prevent this from happening?