Package org.apache.avalon.framework.logger

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


        final DefaultConfigurationBuilder builder = new DefaultConfigurationBuilder();
        final Configuration conf = builder.build(is);

        // Get the logger for the instrument manager
        final String imLoggerCategory = conf.getAttribute("logger", "core.instrument");
        Logger imLogger = this.loggerManager.getLoggerForCategory(imLoggerCategory);

        // Set up the Instrument Manager
        DefaultInstrumentManager instrumentManager = new DefaultInstrumentManager();
        instrumentManager.enableLogging(imLogger);
        instrumentManager.configure(conf);
View Full Code Here


    protected void initLogger() {
        final String accesslogger = getInitParameter("portlet-logger", "cocoon");

        final Hierarchy defaultHierarchy = Hierarchy.getDefaultHierarchy();

        final Logger logger = new LogKitLogger(Hierarchy.getDefaultHierarchy().getLoggerFor(""));

        final LogKitLoggerManager logKitLoggerManager = new LogKitLoggerManager(defaultHierarchy);
        logKitLoggerManager.enableLogging(logger);

        final DefaultContext subcontext = new DefaultContext();
View Full Code Here

        final Hierarchy defaultHierarchy = Hierarchy.getDefaultHierarchy();
        final ErrorHandler errorHandler = new DefaultErrorHandler();
        defaultHierarchy.setErrorHandler(errorHandler);
        defaultHierarchy.setDefaultLogTarget(servTarget);
        defaultHierarchy.setDefaultPriority(logPriority);
        final Logger logger = new LogKitLogger(Hierarchy.getDefaultHierarchy().getLoggerFor(""));
        final String loggerManagerClass =
            this.getInitParameter("logger-class", LogKitLoggerManager.class.getName());

        // the log4j support requires currently that the log4j system is already configured elsewhere
View Full Code Here

        final DefaultConfigurationBuilder builder = new DefaultConfigurationBuilder();
        final Configuration conf = builder.build(is);

        // Get the logger for the instrument manager
        final String imLoggerCategory = conf.getAttribute("logger", "core.instrument");
        Logger imLogger = this.loggerManager.getLoggerForCategory(imLoggerCategory);

        // Set up the Instrument Manager
        DefaultInstrumentManager instrumentManager = new DefaultInstrumentManager();
        instrumentManager.enableLogging(imLogger);
        instrumentManager.configure(conf);
View Full Code Here

        LoggerManager lm = new Log4JLoggerManager();

        // Setup the RoleManager
        DefaultRoleManager roles = new DefaultRoleManager();

        Logger logger = lm.getLoggerForCategory(AVALON_LOG_CATEGORY);

        roles.enableLogging(logger);
        roles.configure(roleConfig);

        // Setup ECM
View Full Code Here

    /**
     * Test debug level.
     */
    public void testDebug()
    {
        final Logger logger = new CommonsLogger((Log)mockLog.proxy(), "JUnit");

        mockLog.expects(once()).method("isDebugEnabled").will(returnValue(true));
        mockLog.expects(once()).method("debug").with(eq("JUnit"));
        mockLog.expects(once()).method("debug").with(eq("JUnit"), same(exception));

        if(logger.isDebugEnabled())
        {
            logger.debug("JUnit");
            logger.debug("JUnit", exception);
        }
    }
View Full Code Here

    /**
     * Test info level.
     */
    public void testInfo()
    {
        final Logger logger = new CommonsLogger((Log)mockLog.proxy(), "JUnit");

        mockLog.expects(once()).method("isInfoEnabled").will(returnValue(true));
        mockLog.expects(once()).method("info").with(eq("JUnit"));
        mockLog.expects(once()).method("info").with(eq("JUnit"), same(exception));

        if(logger.isInfoEnabled())
        {
            logger.info("JUnit");
            logger.info("JUnit", exception);
        }
    }
View Full Code Here

    /**
     * Test warn level.
     */
    public void testWarn()
    {
        final Logger logger = new CommonsLogger((Log)mockLog.proxy(), "JUnit");

        mockLog.expects(once()).method("isWarnEnabled").will(returnValue(true));
        mockLog.expects(once()).method("warn").with(eq("JUnit"));
        mockLog.expects(once()).method("warn").with(eq("JUnit"), same(exception));

        if(logger.isWarnEnabled())
        {
            logger.warn("JUnit");
            logger.warn("JUnit", exception);
        }
    }
View Full Code Here

    /**
     * Test error level.
     */
    public void testError()
    {
        final Logger logger = new CommonsLogger((Log)mockLog.proxy(), "JUnit");

        mockLog.expects(once()).method("isErrorEnabled").will(returnValue(true));
        mockLog.expects(once()).method("error").with(eq("JUnit"));
        mockLog.expects(once()).method("error").with(eq("JUnit"), same(exception));

        if(logger.isErrorEnabled())
        {
            logger.error("JUnit");
            logger.error("JUnit", exception);
        }
    }
View Full Code Here

    /**
     * Test fatal error level.
     */
    public void testFatalError()
    {
        final Logger logger = new CommonsLogger((Log)mockLog.proxy(), "JUnit");

        mockLog.expects(once()).method("isFatalEnabled").will(returnValue(true));
        mockLog.expects(once()).method("fatal").with(eq("JUnit"));
        mockLog.expects(once()).method("fatal").with(eq("JUnit"), same(exception));

        if(logger.isFatalErrorEnabled())
        {
            logger.fatalError("JUnit");
            logger.fatalError("JUnit", exception);
        }
    }
View Full Code Here

TOP

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

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.