Package org.apache.log4j.spi

Examples of org.apache.log4j.spi.ErrorItem


    try {
      in  = url.openStream();
      returnCode = checkIfWellFormed(new InputSource(in), errorList);
    } catch (IOException ioe) {
      String errMsg = "Could not open [" + url + "].";
      errorList.add(new ErrorItem(errMsg, ioe));
      returnCode = UNRECOVERABLE_ERROR;
    } finally {
      if (in != null) {
        try {
          in.close();
View Full Code Here


      result = WELL_FORMED;     
    } catch(org.xml.sax.SAXParseException se) {
      result = ILL_FORMED;
    } catch (Exception ex) {
      errorList.add(
        new ErrorItem("Problem while checking well-formedness", ex));
      result = UNRECOVERABLE_ERROR;
    }

    return result;
  }
View Full Code Here

    if (getNamingContext() == null) {
      try {
        findNamingContext();
      } catch (Exception e) {
        getLogger().error("Couldn't find JNDI naming context: ", e);
        ec.addError(new ErrorItem("Couldn't find JNDI naming context.", e));
      }
    }

    String jndiName = attributes.getValue(NAME_ATTRIBUTE);

    if ((jndiName == null) || (jndiName.trim().length() < 1)) {
      getLogger().warn("Missing {} attribute, ignoring.", NAME_ATTRIBUTE);
    } else if (getNamingContext() != null) {
      Object value = null;

      try {
        value = getNamingContext().lookup(jndiName);
      } catch (Exception e) {
        getLogger().error("Error looking up " + jndiName + ": ", e);
        ec.addError(new ErrorItem("Error looking up " + jndiName, e));
      }

      if (value == null) {
        getLogger().warn("No JNDI value found for {}.", jndiName);
      } else if (!(value instanceof String)) {
View Full Code Here

      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

      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

    try {
      props.load(configStream);
    } catch (java.io.IOException e) {
      String errMsg =
        "Could not read configuration file from input stream.";
      addError(new ErrorItem(errMsg, e));
      getLogger(repository).error(errMsg, e);
      return;
    }

    doConfigure(props, repository);
View Full Code Here

        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

        spf.setNamespaceAware(true);
        saxParser = spf.newSAXParser();
    } catch (Exception pce) {
      final String errMsg = "Parser configuration error occured";
      getLogger(repository).error(errMsg, pce);
      ec.addError(new ErrorItem(errMsg, pce));
      return;
    }
   
    JoranDocument document = new JoranDocument(errorList, repository);
   
    try {
        action.parse(saxParser, document);
    } catch(IOException ie) {
      final String errMsg = "I/O error occured while parsing xml file";
      getLogger(repository).error(errMsg, ie);
      ec.addError(new ErrorItem(errMsg, ie));
    } catch (Exception ex) {
      final String errMsg = "Problem parsing XML document. See previously reported errors. Abandoning all further processing.";
      getLogger(repository).error(errMsg, ex);
      errorList.add(
        new ErrorItem(errMsg));
      return;
    }
   
    ec.pushObject(repository);
    String errMsg;
View Full Code Here

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

        }
        getLogger().info("Skip pattern set to <{}>", skip);
      } catch (Exception e) {
        skip = (Pattern) pattern.clone();
        getLogger().info("Skip pattern set to <{}>", skip);
        ec.addError(new ErrorItem("Exception in Action for tag <"+tagName+">", e));
      }
    }
  }
View Full Code Here

TOP

Related Classes of org.apache.log4j.spi.ErrorItem

Copyright © 2018 www.massapicom. 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.