|
|
@@ -8,10 +8,7 @@ package bandit.util; |
|
|
|
import java.io.IOException; |
|
|
|
import java.io.InputStream; |
|
|
|
import java.time.LocalDateTime; |
|
|
|
import java.util.Map; |
|
|
|
import java.util.Properties; |
|
|
|
import java.util.Set; |
|
|
|
//import java.util.Properties; |
|
|
|
import java.util.logging.*; |
|
|
|
|
|
|
|
/** |
|
|
@@ -57,15 +54,12 @@ public class OhmLogger |
|
|
|
Properties properties = new Properties(); |
|
|
|
properties.load(configFile); |
|
|
|
java.util.logging.Level classLogLevel = java.util.logging.Level.parse(properties.getProperty("log.level")); |
|
|
|
|
|
|
|
|
|
|
|
ConsoleHandler ch = new ConsoleHandler(); |
|
|
|
ch.setFormatter(new OhmFormatter()); |
|
|
|
lg.setUseParentHandlers(false); |
|
|
|
lg.getHandlers(); |
|
|
|
lg.addHandler(ch); |
|
|
|
|
|
|
|
|
|
|
|
lg.setLevel(classLogLevel); |
|
|
|
|
|
|
|
String logDirectory = properties.getProperty("log.directory"); |
|
|
@@ -74,8 +68,7 @@ public class OhmLogger |
|
|
|
FileHandler fileHandler = new FileHandler(logDirectory + "/" + logFileName, true); |
|
|
|
fileHandler.setFormatter(new OhmFormatter()); |
|
|
|
lg.addHandler(fileHandler); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} else { |
|
|
|
System.err.println("Unable to find config.properties file. OhmLogger will use default settings."); |
|
|
|
} |