use of net.logstash.log4j.JSONEventLayoutV1 in project gerrit by GerritCodeReview.
the class ErrorLogFile method initLogSystem.
private static void initLogSystem(Path logdir, Config config) {
final Logger root = LogManager.getRootLogger();
root.removeAllAppenders();
boolean json = config.getBoolean("log", "jsonLogging", false);
boolean text = config.getBoolean("log", "textLogging", true) || !json;
if (text) {
root.addAppender(SystemLog.createAppender(logdir, LOG_NAME, new PatternLayout("[%d] [%t] %-5p %c %x: %m%n")));
}
if (json) {
root.addAppender(SystemLog.createAppender(logdir, LOG_NAME + JSON_SUFFIX, new JSONEventLayoutV1()));
}
}
Aggregations