Examples of StreamTarget


Examples of org.apache.log.output.io.StreamTarget

            ( "%5.5{priority} [%40.40{category}]: %{message}\n%{throwable}" );

        org.apache.log.Logger logger = Hierarchy.getDefaultHierarchy().getLoggerFor( getName() );
        logger.setLogTargets
            ( new LogTarget[]
            {new StreamTarget( System.out, new PatternFormatter( pattern ) )} );
        logger.setPriority( Priority.INFO );

        m_manager.enableLogging( new LogKitLogger( logger ) );
        m_manager.contextualize( new DefaultContext() );
        m_manager.configure( new DefaultConfiguration( "", "" ) );
View Full Code Here

Examples of org.apache.log.output.io.StreamTarget

            // Logger for the portion of the configuration has been loaded.
            logger = Hierarchy.getDefaultHierarchy().getLoggerFor( name );
            logger.setPriority( Priority.INFO );

            PatternFormatter formatter = new PatternFormatter( FORMAT );
            StreamTarget target = new StreamTarget( System.out, formatter );
            logger.setLogTargets( new LogTarget[]{target} );
            m_logger = new LogKitLogger( logger );
        }
        else
        {
View Full Code Here

Examples of org.apache.log.output.io.StreamTarget

            // Logger for the portion of the configuration has been loaded.
            logger = Hierarchy.getDefaultHierarchy().getLoggerFor( name );
            logger.setPriority( Priority.INFO );

            PatternFormatter formatter = new PatternFormatter( FORMAT );
            StreamTarget target = new StreamTarget( System.out, formatter );
            logger.setLogTargets( new LogTarget[]{target} );
        }
        else
        {
            logger = m_logKitManager.getLogger( "test." + name );
View Full Code Here

Examples of org.apache.log.output.io.StreamTarget

        }

        final Configuration formatterConf = configuration.getChild( "format" );
        final Formatter formatter = getFormatter( formatterConf );

        return new StreamTarget( stream, formatter );
    }
View Full Code Here

Examples of org.apache.log.output.io.StreamTarget

        throws ConfigurationException
    {
        final Configuration confFormat = configuration.getChild( "format" );
        final Formatter formatter = getFormatter( confFormat );

        final LogTarget logtarget = new StreamTarget(System.out, formatter);

        return logtarget;
    }
View Full Code Here

Examples of org.apache.log.output.io.StreamTarget

                                   new InnerLoggerListener(),
                                   "", null, null );

        //Setup default output target to print to console
        final PatternFormatter formatter = new PatternFormatter( DEFAULT_FORMAT );
        final StreamTarget target = new StreamTarget( System.out, formatter );

        setDefaultLogTarget( target );
    }
View Full Code Here

Examples of org.apache.log.output.io.StreamTarget

        }

        final Configuration formatterConf = configuration.getChild( "format" );
        final Formatter formatter = getFormatter( formatterConf );

        return new StreamTarget( stream, formatter );
    }
View Full Code Here

Examples of org.apache.log.output.io.StreamTarget

        throws ConfigurationException
    {
        final Configuration confFormat = configuration.getChild( "format" );
        final Formatter formatter = getFormatter( confFormat );

        final LogTarget logtarget = new StreamTarget(System.out, formatter);

        return logtarget;
    }
View Full Code Here

Examples of org.apache.log.output.io.StreamTarget

    public void testPriorityInheritance()
        throws Exception
    {
        final Hierarchy hierarchy = new Hierarchy();
        final ByteArrayOutputStream output = new ByteArrayOutputStream();
        final StreamTarget target = new StreamTarget( output, FORMATTER );
        hierarchy.setDefaultLogTarget( target );

        final Logger b = hierarchy.getLoggerFor( "b" );
        final Logger bc = hierarchy.getLoggerFor( "b.c" );
        final Logger bcd = hierarchy.getLoggerFor( "b.c.d" );
View Full Code Here

Examples of org.apache.log.output.io.StreamTarget

    }

    public void testLogTargetInheritance()
    {
        final ByteArrayOutputStream output1 = new ByteArrayOutputStream();
        final StreamTarget target1 = new StreamTarget( output1, FORMATTER );
        final ByteArrayOutputStream output2 = new ByteArrayOutputStream();
        final StreamTarget target2 = new StreamTarget( output2, FORMATTER2 );

        final LogTarget[] targets1 = new LogTarget[]{target1};
        final LogTarget[] targets2 = new LogTarget[]{target2};

        final Hierarchy hierarchy = new Hierarchy();
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.