Package org.apache.avalon.framework.logger

Examples of org.apache.avalon.framework.logger.LogKitLogger


   
    public void testEmbeddedColon() throws PatternException {
        String expr = "{1}:{1}";
       
        InvokeContext context = new InvokeContext(true);
        context.enableLogging(new LogKitLogger(getLogger()));

        Map sitemapElements;
        sitemapElements = new HashMap();
        sitemapElements.put("1", "abc");
        context.pushMap("label", sitemapElements);
View Full Code Here


    public void testEscapedBraces() throws PatternException {
        String expr = "This is a \\{brace\\}";
       
        InvokeContext context = new InvokeContext(true);
        context.enableLogging(new LogKitLogger(getLogger()));

        Map sitemapElements;
        sitemapElements = new HashMap();
        context.pushMap("label", sitemapElements);
View Full Code Here

    }

    public void testModuleWithoutOption() throws PatternException {
        String expr = "{baselink:}";
        InvokeContext context = new InvokeContext(true);
        context.enableLogging(new LogKitLogger(getLogger()));
       
        Map sitemapElements = new HashMap();
        context.pushMap("sitemap", sitemapElements);
        PreparedVariableResolver resolver = new PreparedVariableResolver(expr, manager);
        assertEquals("", resolver.resolve(context, getObjectModel()));
View Full Code Here

      cfgPassword.setValue(getPassword());
      config.addChild(cfgPassword);
    }

    // log is required to ensure errors are available
    excaliburSource.enableLogging(new LogKitLogger(log));
    excaliburSource.configure(config);
    excaliburSource.setInstrumentableName(getDataSource());
    started[0] = true;
  }
View Full Code Here

    public void initialize() throws Exception {
        try {
            DefaultContext appContext = new DefaultContext();
            appContext.put(Constants.CONTEXT_CLASS_LOADER, Main.class.getClassLoader());
            cliContext = new CommandLineContext(contextDir);
            cliContext.enableLogging(new LogKitLogger(log));
            appContext.put(Constants.CONTEXT_ENVIRONMENT_CONTEXT, cliContext);
            DefaultLogKitManager logKitManager = null;
            if (logKit != null) {
                final FileInputStream fis = new FileInputStream(logKit);
                final DefaultConfigurationBuilder builder = new DefaultConfigurationBuilder();
                final Configuration logKitConf = builder.build(fis);
                logKitManager = new DefaultLogKitManager(Hierarchy.getDefaultHierarchy());
                logKitManager.setLogger(log);
                final DefaultContext subcontext = new DefaultContext(appContext);
                subcontext.put("context-root", contextDir);
                logKitManager.contextualize(subcontext);
                logKitManager.configure(logKitConf);
                if (logger != null) {
                    log = logKitManager.getLogger(logger);
                } else {
                    log = logKitManager.getLogger("cocoon");
                }
            } else {
                logKitManager = new DefaultLogKitManager(Hierarchy.getDefaultHierarchy());
                logKitManager.setLogger(log);
            }
            appContext.put(Constants.CONTEXT_CLASSPATH, getClassPath(contextDir));
            appContext.put(Constants.CONTEXT_WORK_DIR, work);
            appContext.put(Constants.CONTEXT_UPLOAD_DIR, contextDir + "upload-dir");
            File cacheDir = getDir(workDir + File.separator + "cache-dir", "cache");
            appContext.put(Constants.CONTEXT_CACHE_DIR, cacheDir);
            appContext.put(Constants.CONTEXT_CONFIG_URL, conf.toURL());

            loadClasses(classList);

            cocoon = new Cocoon();
            cocoon.enableLogging(new LogKitLogger(log));
            cocoon.contextualize(appContext);
            cocoon.setLogKitManager(logKitManager);
            cocoon.initialize();

            if (brokenLinkFileName != null) {
View Full Code Here

     * @exception Exception if an error occurs
     */
    public void warmup() throws Exception {
        //log.info(" [Cocoon might need to compile the sitemaps, this might take a while]");
        cocoon.generateSitemap(new LinkSamplingEnvironment("/", context, attributes, null, cliContext,
                                                           new LogKitLogger(log)));
    }
View Full Code Here

     */
    private void processXSP(String uri) throws Exception {
        String markupLanguage = "xsp";
        String programmingLanguage = "java";
        Environment env = new LinkSamplingEnvironment("/", context, attributes, null, cliContext,
                                                      new LogKitLogger(log));
        cocoon.precompile(uri, env, markupLanguage, programmingLanguage);
    }
View Full Code Here

     */
    private void processXMAP(String uri) throws Exception {
        String markupLanguage = "sitemap";
        String programmingLanguage = "java";
        Environment env = new LinkSamplingEnvironment("/", context, attributes, null, cliContext,
                                                      new LogKitLogger(log));
        cocoon.precompile(uri, env, markupLanguage, programmingLanguage);
    }
View Full Code Here

        LinkSamplingEnvironment env = new LinkSamplingEnvironment(deparameterizedURI,
                                                                  context,
                                                                  attributes,
                                                                  parameters,
                                                                  cliContext,
                                                                  new LogKitLogger(log));
        processLenient(env);
        return env.getLinks();
    }
View Full Code Here

                                                              parameters,
                                                              links,
                                                              gatheredLinks,
                                                              cliContext,
                                                              stream,
                                                              new LogKitLogger(log));
        // Here Cocoon can throw an exception if there are errors in processing the page
        cocoon.process(env);
        // if we get here, the page was created :-)
        return env.getContentType();
    }
View Full Code Here

TOP

Related Classes of org.apache.avalon.framework.logger.LogKitLogger

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.