@Managed(description = "Get the count of log events for the specified level") public long getLogLevelCountByLevel(final String levelString) { final long[] counts = counter.getLogLevelCounts(); final LevelIndex lIndex = LevelIndex.getLevelIndexFromLevelString(levelString); if (lIndex == null) { return -1; } else { return counts[lIndex.getIndex()]; } }
@Managed(description = "Retrieve the status of log counting per level") public String[] getLogLevelCountingEnabled() { final String[] levelMessages = new String[LevelIndex.getNumLevels()]; for (final LevelIndex lIndex : LevelIndex.values()) { final String levelString = lIndex.getLevelString(); levelMessages[lIndex.getIndex()] = levelString + ": " + counter.getCountingEnabledByLevel(lIndex.getLevel()); } return levelMessages; }
@Managed(description = "Get the count of log events per level") public String[] getLogLevelCounts() { final long[] counts = counter.getLogLevelCounts(); final String[] levelMessages = new String[LevelIndex.getNumLevels()]; for (final LevelIndex lIndex : LevelIndex.values()) { final String levelString = lIndex.getLevelString(); levelMessages[lIndex.getIndex()] = levelString + ": " + counts[lIndex.getIndex()]; } return levelMessages; }
@Managed(description = "Enable or disable log counting per level") public void setLogLevelCountingEnabledByLevel(final String levelString, final boolean enabled) { final Level level = LevelIndex.getLevelFromLevelString(levelString); counter.setCountingEnabledByLevel(level, enabled); }
@Managed(description = "Reset all counters") public void resetStats() { counter.resetAllLogLevelCounts(); lastResetTimeMillis.set(System.currentTimeMillis()); }