/** * Create a default logging fraction for the specified level. * * @return The fully-configured fraction. */ public static LoggingFraction createDefaultLoggingFraction(Level level) { return new LoggingFraction().applyDefaults(level); }
/** * Create a default logging fraction for the specified level. * * @return The fully-configured fraction. */ public static LoggingFraction createDefaultLoggingFraction(Level level) { return new LoggingFraction() .defaultColorFormatter() .consoleHandler(level, COLOR_PATTERN) .rootLogger(level, CONSOLE); }
/** * Create a default logging fraction for the specified level. * * @return The fully-configured fraction. */ public static LoggingFraction createDefaultLoggingFraction(String level) { return new LoggingFraction() .defaultColorFormatter() .consoleHandler(level, COLOR_PATTERN) .rootLogger(level, CONSOLE); }
@Override public void initialize(Container.InitContext initContext) { final CustomHandler<?> logstashHandler = new CustomHandler<>("logstash-handler") .module("org.jboss.logmanager.ext") .attributeClass("org.jboss.logmanager.ext.handlers.SocketHandler") .namedFormatter("logstash") .properties(handlerProperties); initContext.fraction(new LoggingFraction() .customFormatter("logstash", "org.jboss.logmanager.ext", "org.jboss.logmanager.ext.formatters.LogstashFormatter", this.formatterProperties) .customHandler(logstashHandler) .rootLogger(this.level, logstashHandler.getKey())); }