Package ch.qos.logback.core.joran.spi

Examples of ch.qos.logback.core.joran.spi.ExecutionContext


  final public void doConfigure(final InputSource inputSource) {
    // This line is needed here because there is logging from inside this method.
    selfInitialize(this.context);
   
    ExecutionContext ec = joranInterpreter.getExecutionContext();


    SAXParser saxParser = null;
    try {
        SAXParserFactory spf = SAXParserFactory.newInstance();
        spf.setValidating(false);
        spf.setNamespaceAware(true);
        saxParser = spf.newSAXParser();
    } catch (Exception pce) {
      String errMsg = "Parser configuration error occured";
      ec.addError(errMsg, pce);
      return;
    }
   
    try {
      // attachListAppender(context);
      saxParser.parse(inputSource, joranInterpreter);
    } catch(IOException ie) {
      final String errMsg = "I/O error occurred while parsing xml file";
      ec.addError(errMsg, ie);
    } catch (Exception ex) {
      final String errMsg = "Problem parsing XML document. See previously reported errors. Abandoning all further processing.";
      addError(errMsg, ex);
      return;
    } finally {
View Full Code Here


    rs.addRule(
      new Pattern("configuration/newRule"), new NewRuleAction());
    rs.addRule(new Pattern("*/param"), new ParamAction());
   
    joranInterpreter = new Interpreter(rs);
    ExecutionContext ec = joranInterpreter.getExecutionContext();
    ec.setContext(context);
   
    // The following line adds the capability to parse nested components
    NestedComponentIA nestedIA = new NestedComponentIA();
    nestedIA.setContext(context);
    joranInterpreter.addImplicitAction(nestedIA);

    NestedSimplePropertyIA nestedSimpleIA = new NestedSimplePropertyIA();
    nestedIA.setContext(context);
    joranInterpreter.addImplicitAction(nestedSimpleIA);

    Map<String, Object> 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 ch.qos.logback.core.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.