/**
  * Stop this appender instance. The underlying stream or writer is also closed.
  *
  * <p>Stopped appenders cannot be reused.
  */
 public void stop() {
   lock.lock();
   try {
     closeOutputStream();
     super.stop();
   } finally {
     lock.unlock();
   }
 }
  /**
   * Checks that requires parameters are set and if everything is in order, activates this appender.
   */
  public void start() {
    int errors = 0;
    if (this.encoder == null) {
      addStatus(new ErrorStatus("No encoder set for the appender named \"" + name + "\".", this));
      errors++;
    }

    if (this.outputStream == null) {
      addStatus(
          new ErrorStatus("No output stream set for the appender named \"" + name + "\".", this));
      errors++;
    }
    // only error free appenders should be activated
    if (errors == 0) {
      super.start();
    }
  }