@Override
  public void append(LogEvent event) {
    if (stop.get()) {
      return;
    }
    // for accounting, here we always convert the event to byte array first
    // this will effect performance a bit but it is OK since this is for UT only
    byte[] bytes = getLayout().toByteArray(event);
    if (bytes == null || bytes.length == 0) {
      return;
    }
    long sizeAfterAppend = size.addAndGet(bytes.length);
    if (sizeAfterAppend >= maxSize) {
      // stop logging if the log size exceeded the limit
      if (stop.compareAndSet(false, true)) {
        LOGGER.error("Log size exceeded the limit {}, will stop logging to prevent eating"
          + " too much disk space", maxSize);
      }
      return;
    }
    super.append(event);
  }
Create an OutputStreamManager.
@param name The name of the entity to manage.
@param data The data required to create the entity.
@return The OutputStreamManager
hbase-logging/src/test/java/org/apache/hadoop/hbase/logging/HBaseTestAppender.java