Package org.apache.avalon.excalibur.logger

Examples of org.apache.avalon.excalibur.logger.LoggerManager


    if (! logConfigDir.endsWith("/"))
    {
      logConfigDir = logConfigDir + "/";
    }

    LoggerManager lm = createLogkitLoggerManager(logConfigDir);

    if (lm == null)
    {
      //If a logkit configuration file does not exist, attempt to
      // use log4j to implement our logging facade
View Full Code Here


    // will NOT rely on log4j's
    //default initialization sequence, instead we will search for
    // a configuration file only in logConfigDir.
    //If the log4j standard initialization system property is set,
    // use it
    LoggerManager lm = null;
    String logConfigFilename = System.getProperty("log4j.configuration");

    if (logConfigFilename == null || logConfigFilename.length() < 1)
    {
      logConfigFilename = LOG4J_FILE_NAME;
View Full Code Here

   * @param logConfigFile
   * @return
   */
  private LoggerManager createLogkitLoggerManager(String logConfigDir)
  {
    LoggerManager lm = null;
    String logConfigFilename = logConfigDir + LOGKIT_FILE_NAME;

    logConfigFile = new File(logConfigFilename);

    if (logConfigFile.exists())
View Full Code Here

        DefaultConfigurationBuilder builder = new DefaultConfigurationBuilder();
        Configuration sysConfig  = builder.buildFromFile(sysConfigFilename);
        Configuration roleConfig = builder.buildFromFile(roleConfigFilename);

        // Create the LoggerManager for Log4J
        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

        final String loggerManagerClass =
            this.getInitParameter("logger-class", LogKitLoggerManager.class.getName());

        // the log4j support requires currently that the log4j system is already configured elsewhere

        final LoggerManager loggerManager =
                newLoggerManager(loggerManagerClass, defaultHierarchy);
        ContainerUtil.enableLogging(loggerManager, logger);

        final DefaultContext subcontext = new DefaultContext(this.appContext);
        subcontext.put("servlet-context", this.servletContext);
View Full Code Here

       
        final CocoonComponentManager manager = new CocoonComponentManager(this.parentManager);
       
        manager.enableLogging(getLogger());
       
        final LoggerManager loggerManager = (LoggerManager) this.parentManager.lookup(LoggerManager.ROLE);
        manager.setLoggerManager(loggerManager);

        if (null != this.context ) {
            manager.contextualize(this.context);
        }
View Full Code Here

        final String loggerManagerClass =
            this.getInitParameter("logger-class", LogKitLoggerManager.class.getName());

        // the log4j support requires currently that the log4j system is already configured elsewhere

        final LoggerManager loggerManager =
                newLoggerManager(loggerManagerClass, defaultHierarchy);
        ContainerUtil.enableLogging(loggerManager, logger);

        final DefaultContext subcontext = new DefaultContext(this.appContext);
        subcontext.put("servlet-context", this.servletContext);
View Full Code Here

            {
                throw new ServletException( "Encountered an error closing resource streams.", e );
            }
        }

        LoggerManager loggerManager = m_componentManagerCreator.getLoggerManager();

        // A series of ReferenceProxies which will be used to access the ComponentManager
        //  and other managers created by the ComponentManagerCreator must be created.
        //  This is necessary because the order in which servlets are shut down by a
        //  ServletContainer can not be controlled.  If a manager is disposed before all
        //  servlets have released their references to it, then errors can result.

        // Create the latch which will manager the ReferenceProxies.
        m_latch = new Latch( m_componentManagerCreator );
        m_latch.enableLogging( loggerManager.getLoggerForCategory( "system.ecmservlet" ) );

        // Create the actual ReferenceProxies.
        ReferenceProxy loggerManagerProxy = m_latch.createProxy(
            loggerManager, "LoggerManager" );
        ReferenceProxy serviceManagerProxy = m_latch.createProxy(
View Full Code Here

        throws ServletException
    {
        ServletContext context = config.getServletContext();

        // Initialize logging for the servlet.
        LoggerManager loggerManager =
            (LoggerManager)context.getAttribute( LoggerManager.class.getName() );
        if( loggerManager == null )
        {
            throw new IllegalStateException(
                "The ExcaliburComponentManagerServlet servlet was not correctly initialized." );
        }
        Logger logger = loggerManager.getLoggerForCategory( "servlet" );
        m_logger = logger.getChildLogger( m_referenceName );

        if( getLogger().isDebugEnabled() )
        {
            getLogger().debug( "servlet.init( config )" );
View Full Code Here

        throws ServletException
    {
        ServletContext context = config.getServletContext();

        // Initialize logging for the servlet.
        LoggerManager loggerManager =
            (LoggerManager)context.getAttribute( LoggerManager.class.getName() );
        if ( loggerManager == null )
        {
            throw new IllegalStateException(
                "The ExcaliburComponentManagerServlet servlet was not correctly initialized." );
        }
        Logger logger = loggerManager.getLoggerForCategory( "servlet" );
        m_logger = logger.getChildLogger( m_referenceName );

        if ( getLogger().isDebugEnabled() )
        {
            getLogger().debug( "servlet.init( config )" );
View Full Code Here

TOP

Related Classes of org.apache.avalon.excalibur.logger.LoggerManager

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.