@Test public void metersWarnEvents() throws Exception { when(event.getLevel()).thenReturn(WARN); appender.append(event); assertEquals(1, getLogLevelCount("warn")); }
@Override public void append(LogEvent event) { Level level = event.getLevel(); if (TRACE.equals(level)) TRACE_LABEL.inc(); else if (DEBUG.equals(level)) DEBUG_LABEL.inc(); else if (INFO.equals(level)) INFO_LABEL.inc(); else if (WARN.equals(level)) WARN_LABEL.inc(); else if (ERROR.equals(level)) ERROR_LABEL.inc(); else if (FATAL.equals(level)) FATAL_LABEL.inc(); }
InstrumentedAppender extends AbstractAppender { @Override public void append(LogEvent event) { Level level = event.getLevel(); if (TRACE.equals(level)) TRACE_LABEL.inc(); else if (DEBUG.equals(level)) DEBUG_LABEL.inc(); else if (INFO.equals(level)) INFO_LABEL.inc(); else if (WARN.equals(level)) WARN_LABEL.inc(); else if (ERROR.equals(level)) ERROR_LABEL.inc(); else if (FATAL.equals(level)) FATAL_LABEL.inc(); } }
InstrumentedAppender extends AbstractAppender { @Override public void append(LogEvent event) { Level level = event.getLevel(); if (TRACE.equals(level)) TRACE_LABEL.inc(); else if (DEBUG.equals(level)) DEBUG_LABEL.inc(); else if (INFO.equals(level)) INFO_LABEL.inc(); else if (WARN.equals(level)) WARN_LABEL.inc(); else if (ERROR.equals(level)) ERROR_LABEL.inc(); else if (FATAL.equals(level)) FATAL_LABEL.inc(); } protected  InstrumentedAppender(String name); }
InstrumentedAppender extends AbstractAppender { @Override public void append(LogEvent event) { Level level = event.getLevel(); if (TRACE.equals(level)) TRACE_LABEL.inc(); else if (DEBUG.equals(level)) DEBUG_LABEL.inc(); else if (INFO.equals(level)) INFO_LABEL.inc(); else if (WARN.equals(level)) WARN_LABEL.inc(); else if (ERROR.equals(level)) ERROR_LABEL.inc(); else if (FATAL.equals(level)) FATAL_LABEL.inc(); } protected  InstrumentedAppender(String name); @Override void append(LogEvent event); @PluginFactory static InstrumentedAppender createAppender(
            @PluginAttribute("name") String name); }
InstrumentedAppender extends AbstractAppender { @Override public void append(LogEvent event) { Level level = event.getLevel(); if (TRACE.equals(level)) TRACE_LABEL.inc(); else if (DEBUG.equals(level)) DEBUG_LABEL.inc(); else if (INFO.equals(level)) INFO_LABEL.inc(); else if (WARN.equals(level)) WARN_LABEL.inc(); else if (ERROR.equals(level)) ERROR_LABEL.inc(); else if (FATAL.equals(level)) FATAL_LABEL.inc(); } protected  InstrumentedAppender(String name); @Override void append(LogEvent event); @PluginFactory static InstrumentedAppender createAppender(
            @PluginAttribute("name") String name); static final String COUNTER_NAME; }