URL configURL = getClass().getResource("/config/JDKLog.properties");
InputStream ins;
try {
ins = configURL.openStream();
if( ins != null )
logMgr.readConfiguration(ins);
else
logger.log( Level.WARNING, "Failed to open JDKLog.properties");
} catch (IOException e) {
// TODO 자동 생성된 catch 블록
e.printStackTrace();
}
---------------------JDKLog.properties-------------------
handlers=java.util.logging.ConsoleHandler
java.util.logging.ConsoleHandler.level=ALL
.level=FINEST
java login API included since JDK1.4. It is very flexable toolkit. You can use own handler, filter and formtter.
답글삭제How to config logger.
You can use properties file to config your logger. Default file is JAVA_HOME/lib/logging.properties. If you want to use another property file, you can specify file path with -D JVM option.