Examples of ErrorItem


Examples of org.apache.log4j.spi.ErrorItem

    int result = XMLUtil.checkIfWellFormed(url, errorList);
    switch (result) {
    case XMLUtil.ILL_FORMED:
    case XMLUtil.UNRECOVERABLE_ERROR:
      errorList.add(
        new ErrorItem(
          "Problem parsing XML document. See previously reported errors. Abandoning all furhter processing."));
      return;
    }

    String errMsg;
    try {
      InputStream in = url.openStream();
      doConfigure(in, repository);
      in.close();
    } catch (IOException ioe) {
      errMsg = "Could not open [" + url + "].";
      getLogger(repository).error(errMsg, ioe);
      ec.addError(new ErrorItem(errMsg, ioe));
    }
  }
View Full Code Here

Examples of org.apache.log4j.spi.ErrorItem

    if(Option.isEmpty(pattern)) {
       inError = true;
       errorMsg = "No 'pattern' attribute in <newRule>";
       logger.warn(errorMsg);
       ec.addError(new ErrorItem(errorMsg));
       return;
     }
   
     if(Option.isEmpty(actionClass)) {
         inError = true;
         errorMsg = "No 'actionClass' attribute in <newRule>";
         logger.warn(errorMsg);
         ec.addError(new ErrorItem(errorMsg));
         return;
     }
      
    try {
      logger.debug("About to add new Joran parsing rule ["+pattern+","+actionClass+"].");
      ec.getJoranInterpreter().getRuleStore().addRule(new Pattern(pattern), actionClass);
    } catch (Exception oops) {
      inError = true;
      errorMsg =  "Could not add new Joran parsing rule ["+pattern+","+actionClass+"]";
      logger.error(errorMsg, oops);
      ec.addError(new ErrorItem(errorMsg));
    }
  }
View Full Code Here

Examples of org.apache.log4j.spi.ErrorItem

      props.load(istream);
      istream.close();
    } catch (IOException e) {
      String errMsg =
        "Could not read configuration file [" + configFileName + "].";
      addError(new ErrorItem(errMsg, e));
      getLogger(repo).error(errMsg, e);
      return;
    }

    // If we reach here, then the config file is alright.
View Full Code Here

Examples of org.apache.log4j.spi.ErrorItem

      props.load(in);
      in.close();
    } catch (java.io.IOException e) {
      String errMsg =
        "Could not read configuration file from URL [" + configURL + "].";
      addError(new ErrorItem(errMsg, e));
      getLogger(repository).error(errMsg, e);
      return;
    }

    doConfigure(props, repository);
View Full Code Here

Examples of org.apache.log4j.spi.ErrorItem

        props, prefix, org.apache.log4j.Appender.class, null);

    if (appender == null) {
      String errMsg =
        "Could not instantiate appender named \"" + appenderName + "\".";
      addError(new ErrorItem(errMsg));
      getLogger(repository).error(errMsg);
      return null;
    }

    appender.setName(appenderName);
View Full Code Here

Examples of org.apache.log4j.spi.ErrorItem

   
    ListAppender listAppender = (ListAppender) ll.getAppender(Constants.TEMP_LIST_APPENDER_NAME);
    if(listAppender == null) {
      String errMsg = "Could not find appender "+Constants.TEMP_LIST_APPENDER_NAME;
      getLogger(repository).error(errMsg);
      addError(new ErrorItem(errMsg));
      return;
    }
   
    List eventList = listAppender.getList();
    int size = eventList.size();
View Full Code Here

Examples of org.apache.log4j.spi.ErrorItem

    ConsoleAppender consoleAppender =
      (ConsoleAppender) ll.getAppender(Constants.TEMP_CONSOLE_APPENDER_NAME);
    if (consoleAppender == null) {
      String errMsg =
        "Could not find appender " + Constants.TEMP_LIST_APPENDER_NAME;
      errorList.add(new ErrorItem(errMsg));
      return;
    }
    consoleAppender.close();
    ll.removeAppender(consoleAppender);
  }
View Full Code Here

Examples of org.apache.log4j.spi.ErrorItem

   * Dump any errors on System.out.
   */
  public void dumpErrors() {
    List errorList = getErrorList();
    for(int i = 0; i < errorList.size(); i++) {
      ErrorItem ei = (ErrorItem) errorList.get(i);
      System.out.println(ei);
      Throwable t = ei.getException();
      if(t != null) {
        t.printStackTrace(System.out);
      }
    }
  }
View Full Code Here

Examples of org.apache.log4j.spi.ErrorItem

      String errMsg =
        "no applicable action for <" + tagName + ">, current pattern is ["
        + pattern+"]";
      logger.warn(errMsg);
      ec.addError(new ErrorItem(errMsg));
    }
  }
View Full Code Here

Examples of org.apache.log4j.spi.ErrorItem

      // now ket us invoke the action. We catch and report any eventual
      // exceptions
      try {
        action.begin(ec, tagName, atts);
      } catch (Exception e) {
        ec.addError(new ErrorItem("Action threw an exception", e));
      }
    }
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.