} catch (NodeNeedRestartException e) {
// impossible
System.err.println("impossible NodeNeedRestartException for logger.priority in config file: "
+ config.getString("priority"));
}
FileLoggerHook hook;
try {
hook =
new FileLoggerHook(true, new File(logDir, LOG_PREFIX).getAbsolutePath(),
"d (c, t, p): m", "MMM dd, yyyy HH:mm:ss:SSS", logRotateInterval, LogLevel.DEBUG /* filtered by chain */, false, true,
maxZippedLogsSize /* 1GB of old compressed logfiles */, maxCachedLogLines);
} catch (IOException e) {
System.err.println("CANNOT START LOGGER: "+e.getMessage());
return;
} catch (IntervalParseException e) {
System.err.println("INVALID LOGGING INTERVAL: "+e.getMessage());
logRotateInterval = "5MINUTE";
try {
hook =
new FileLoggerHook(true, new File(logDir, LOG_PREFIX).getAbsolutePath(),
"d (c, t, p): m", "MMM dd, yyyy HH:mm:ss:SSS", logRotateInterval, LogLevel.DEBUG /* filtered by chain */, false, true,
maxZippedLogsSize /* 1GB of old compressed logfiles */, maxCachedLogLines);
} catch (IntervalParseException e1) {
System.err.println("CANNOT START LOGGER: IMPOSSIBLE: "+e1.getMessage());
return;
} catch (IOException e1) {
System.err.println("CANNOT START LOGGER: "+e1.getMessage());
return;
}
}
hook.setMaxListBytes(maxCachedLogBytes);
hook.setMaxBacklogNotBusy(maxBacklogNotBusy);
fileLoggerHook = hook;
Logger.globalAddHook(hook);
hook.start();
}
}