public static void log2file(Logger logger, String msg) {
FileHandler fh = null;
try {
fh = new FileHandler(System.getProperty("user.home")+File.separator+"EZScope.log",5120,5,true);
fh.setFormatter(new SimpleFormatter());
logger.addHandler(fh);
logger.info(msg);
fh.close();
} catch (Exception e) {
e.printStackTrace();
} finally{
if (fh!=null) {
fh.close();
}
}
}
FileHandler fh = null;
try {
fh = new FileHandler(System.getProperty("user.home")+File.separator+"EZScope.log",5120,5,true);
fh.setFormatter(new SimpleFormatter());
logger.addHandler(fh);
logger.info(msg);
fh.close();
} catch (Exception e) {
e.printStackTrace();
} finally{
if (fh!=null) {
fh.close();
}
}
}