Package org.apache.log4j.joran.spi

Examples of org.apache.log4j.joran.spi.ExecutionContext


  protected void doConfigure(final ParseAction action, final LoggerRepository repository) {
    // This line is needed here because there is logging from inside this method.
    this.repository = repository;
    selfInitialize(this.repository);
   
    ExecutionContext ec = joranInterpreter.getExecutionContext();
    List errorList = ec.getErrorList();

    SAXParser saxParser = null;
    try {
        SAXParserFactory spf = SAXParserFactory.newInstance();
        spf.setValidating(false);
        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;
    try {
      attachListAppender(repository);
     
      document.replay(joranInterpreter);
View Full Code Here


    joranInterpreter = new Interpreter(rs);
    joranInterpreter.setLoggerRepository(repository);
   
    // The following line adds the capability to parse nested components
    joranInterpreter.addImplicitAction(new NestComponentIA());
    ExecutionContext ec = joranInterpreter.getExecutionContext();

    Map omap = ec.getObjectMap();
    omap.put(ActionConst.APPENDER_BAG, new HashMap());
    omap.put(ActionConst.FILTER_CHAIN_BAG, new HashMap());
  }
View Full Code Here

  protected void doConfigure(final ParseAction action, final LoggerRepository repository) {
    // This line is needed here because there is logging from inside this method.
    this.repository = repository;
    selfInitialize(this.repository);
   
    ExecutionContext ec = joranInterpreter.getExecutionContext();
    List errorList = ec.getErrorList();

    SAXParser saxParser = null;
    try {
        SAXParserFactory spf = SAXParserFactory.newInstance();
        spf.setValidating(false);
        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;
    try {
      attachListAppender(repository);
     
      document.replay(joranInterpreter);
View Full Code Here

    joranInterpreter = new Interpreter(rs);
    joranInterpreter.setLoggerRepository(repository);
   
    // The following line adds the capability to parse nested components
    joranInterpreter.addImplicitAction(new NestComponentIA());
    ExecutionContext ec = joranInterpreter.getExecutionContext();

    Map omap = ec.getObjectMap();
    omap.put(ActionConst.APPENDER_BAG, new HashMap());
    omap.put(ActionConst.FILTER_CHAIN_BAG, new HashMap());
  }
View Full Code Here

TOP

Related Classes of org.apache.log4j.joran.spi.ExecutionContext

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.