Examples of LogKitLogger


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

    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

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

     * @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

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

     */
    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

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

     */
    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

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

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

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

                                                              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

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

                                                              parameters,
                                                              empty,
                                                              null,
                                                              cliContext,
                                                              new NullOutputStream(),
                                                              new LogKitLogger(log));
        processLenient(env);
        return env.getContentType();
    }
View Full Code Here

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

     * The result will be cached by
     * <code>AbstractLoggerManager.getLoggerForCategory()</code>.
     */
    protected Logger doGetLoggerForCategory( final String fullCategoryName )
    {
        return new LogKitLogger( m_hierarchy.getLoggerFor( fullCategoryName ) );
    }
View Full Code Here

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

            final String fullCategory =
                    LoggerUtil.getFullCategoryName( parentCategory, category );

            final org.apache.log.Logger logger = m_hierarchy.getLoggerFor( fullCategory );
            m_loggers.put( fullCategory, new LogKitLogger( logger ) );
            if( getLogger().isDebugEnabled() )
            {
                getLogger().debug( "added logger for category " + fullCategory );
            }
            logger.setPriority( Priority.getPriorityForName( loglevel ) );
View Full Code Here

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

        {
            return getDefaultLogger();
        }
        else
        {
            return new LogKitLogger( m_hierarchy.getLoggerFor( categoryName ) );
        }
    }
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.