Пример #1
0
 @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()];
   }
 }
Пример #2
0
  @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;
  }
Пример #3
0
  @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;
  }
Пример #4
0
 @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);
 }
Пример #5
0
 @Managed(description = "Reset all counters")
 public void resetStats() {
   counter.resetAllLogLevelCounts();
   lastResetTimeMillis.set(System.currentTimeMillis());
 }