/**
   * Log a message on the Logger associated with our Container (if any).
   *
   * @param message Message to be logged
   */
  protected void log(String message) {

    Logger logger = null;
    if (container != null) logger = container.getLogger();
    if (logger != null) logger.log("StandardPipeline[" + container.getName() + "]: " + message);
    else System.out.println("StandardPipeline[" + container.getName() + "]: " + message);
  }
  /**
   * Log a message on the Logger associated with our Container (if any).
   *
   * @param message Message to be logged
   * @param throwable Associated exception
   */
  protected void log(String message, Throwable throwable) {

    Logger logger = null;
    if (container != null) logger = container.getLogger();
    if (logger != null)
      logger.log("StandardPipeline[" + container.getName() + "]: " + message, throwable);
    else {
      System.out.println("StandardPipeline[" + container.getName() + "]: " + message);
      throwable.printStackTrace(System.out);
    }
  }
Пример #3
0
  /**
   * Log a message on the Logger associated with our Container (if any)
   *
   * @param message Message to be logged
   */
  protected void log(String message) {

    Logger logger = null;
    String name = null;
    if (container != null) {
      logger = container.getLogger();
      name = container.getName();
    }

    if (logger != null) {
      logger.log(getName() + "[" + name + "]: " + message);
    } else {
      System.out.println(getName() + "[" + name + "]: " + message);
    }
  }
Пример #4
0
  /**
   * Logs the given message to the Logger associated with the Container (if any) of this
   * StandardPipeline.
   *
   * @param message the message
   * @param t the Throwable
   */
  protected void log(String message, Throwable t) {
    org.apache.catalina.Logger logger = null;
    if (container != null) {
      logger = container.getLogger();

      String msg =
          MessageFormat.format(
              rb.getString(STANDARD_PIPELINE_INFO), new Object[] {container.getName(), message});

      if (logger != null) {
        logger.log(msg, t, org.apache.catalina.Logger.WARNING);
      } else {
        log.log(Level.WARNING, msg, t);
      }
    } else {
      String msg = MessageFormat.format(rb.getString(STANDARD_PIPELINE_NULL_INFO), message);
      log.log(Level.WARNING, msg, t); // INFO set to WARNING
    }
  }
Пример #5
0
  /**
   * Log a message on the Logger associated with our Container (if any).
   *
   * @param message Message to be logged
   */
  protected void log(String message) {
    org.apache.catalina.Logger logger = null;
    if (container != null) {
      logger = container.getLogger();

      String msg =
          MessageFormat.format(
              rb.getString(STANDARD_PIPELINE_INFO), new Object[] {container.getName(), message});

      if (logger != null) {
        logger.log(msg);
      } else {
        if (log.isLoggable(Level.INFO)) {
          log.log(Level.INFO, msg);
        }
      }
    } else {
      if (log.isLoggable(Level.INFO)) {
        String msg = MessageFormat.format(rb.getString(STANDARD_PIPELINE_NULL_INFO), message);
        log.log(Level.INFO, msg);
      }
    }
  }