Package org.apache.log

Examples of org.apache.log.Hierarchy$InnerLoggerListener


        final CocoonLogFormatter formatter = new CocoonLogFormatter();
        formatter.setFormat("%7.7{priority} %{time}   [%8.8{category}] " +
                            "(%{uri}) %{thread}/%{class:short}: %{message}\\n%{throwable}");
        final PortletOutputLogTarget servTarget = new PortletOutputLogTarget(this.portletContext, formatter);

        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


    String cfg = p.getProperty("log_config");
    if (cfg == null)
      return;

    // Make sure same hierarchy is used
    Hierarchy hier = Hierarchy.getDefaultHierarchy();
    LogKitLoggerManager manager = new LogKitLoggerManager(null, hier, null, null);

    DefaultConfigurationBuilder builder = new DefaultConfigurationBuilder();
    try {
      Configuration c = builder.buildFromFile(cfg);
View Full Code Here

     * own LoggerManager running on top of LogKit flavour.
     */
    public static LoggerManager createLogKitConfigurable(
            final String prefix, final String switchTo )
    {
        final org.apache.log.Hierarchy hierarchy = new Hierarchy();

        final LoggerManager bare = new LogKitAdapter( hierarchy );
        final LoggerManager decorated = applyDecorators( bare, prefix, switchTo );
        final LoggerManagerTee tee = new LoggerManagerTee( decorated );

View Full Code Here

    /**
     * Creates a new <code>DefaultLogKitManager</code>. It will use a new <code>Hierarchy</code>.
     */
    public DefaultLogKitManager()
    {
        this( new Hierarchy() );
    }
View Full Code Here

     * Creates a new <code>DefaultLogKitManager</code> using
     * specified logger name as root logger.
     */
    public DefaultLogKitManager( final String prefix )
    {
        this( prefix, new Hierarchy() );
    }
View Full Code Here

        super( prefix, switchToCategory, defaultLoggerOverride );
        m_prefix = prefix;

        if ( hierarchy == null )
        {
            m_hierarchy = new Hierarchy();
            m_hierarchy.getRootLogger().unsetLogTargets( true );
            final ErrorHandler errorHandler = new OurErrorHandler( getLogger() );
            m_hierarchy.setErrorHandler( errorHandler );
        }
        else
View Full Code Here

        final File file = new File( logDestination );
        final FileTarget logTarget = new FileTarget( file, false, formatter );

        //Create an anonymous hierarchy so no other
        //components can get access to logging hierarchy
        final Hierarchy hierarchy = new Hierarchy();
        final org.apache.log.Logger logger = hierarchy.getLoggerFor( "Phoenix" );
        logger.setLogTargets( new LogTarget[]{logTarget} );
        logger.setPriority( Priority.getPriorityForName( logPriority ) );
        logger.info( "Logger started" );
        return new LogKitLogger( logger );
    }
View Full Code Here

        final CocoonLogFormatter formatter = new CocoonLogFormatter();
        formatter.setFormat("%7.7{priority} %{time}   [%8.8{category}] " +
                            "(%{uri}) %{thread}/%{class:short}: %{message}\\n%{throwable}");
        final PortletOutputLogTarget servTarget = new PortletOutputLogTarget(this.portletContext, formatter);

        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

    }

    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);
View Full Code Here

    public void initialize() throws Exception {
        // @todo@ these should log then throw exceptions back to the caller, not use system.exit()

        // Create a new hierarchy. This is needed when CocoonBean is called from
        // within a CocoonServlet call, in order not to mix logs
        final Hierarchy hierarchy = new Hierarchy();

        final Priority priority = Priority.getPriorityForName(logLevel);
        hierarchy.setDefaultPriority(priority);

        // Install a temporary logger so that getDir() can log if needed
        this.log = new LogKitLogger(hierarchy.getLoggerFor(""));

        try {
            // First of all, initialize the logging system

            // Setup the application context with context-dir and work-dir that
View Full Code Here

TOP

Related Classes of org.apache.log.Hierarchy$InnerLoggerListener

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.