Ejemplo n.º 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()];
   }
 }
Ejemplo n.º 2
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;
  }