Examples of RevolvingFileStrategy


Examples of org.apache.log.output.io.rotate.RevolvingFileStrategy

            final int initialRotation =
                conf.getAttributeAsInteger( "init", 5 );
            final int maxRotation =
                conf.getAttributeAsInteger( "max", 10 );

            return new RevolvingFileStrategy( file, initialRotation, maxRotation );
        }

        // default file strategy
        final String pattern = conf.getAttribute( "pattern", null );
        final String suffix = conf.getAttribute( "suffix", null );
View Full Code Here

Examples of org.apache.log.output.io.rotate.RevolvingFileStrategy

    public void testNew()
        throws Exception
    {
        deleteFiles( 9 );

        final RevolvingFileStrategy strategy =
            new RevolvingFileStrategy( m_baseFile, 9 );

        assertEquals( "rotation", 0, strategy.getCurrentRotation() );
    }
View Full Code Here

Examples of org.apache.log.output.io.rotate.RevolvingFileStrategy

        throws Exception
    {
        deleteFiles( 9 );
        createFile( 0, 0 );

        final RevolvingFileStrategy strategy =
            new RevolvingFileStrategy( m_baseFile, 9 );

        assertEquals( "rotation", 1, strategy.getCurrentRotation() );
    }
View Full Code Here

Examples of org.apache.log.output.io.rotate.RevolvingFileStrategy

        createFile( 1, 0 );
        createFile( 2, 0 );
        createFile( 3, 0 );
        createFile( 4, 0 );

        final RevolvingFileStrategy strategy =
            new RevolvingFileStrategy( m_baseFile, 9 );

        assertEquals( "rotation", 5, strategy.getCurrentRotation() );
    }
View Full Code Here

Examples of org.apache.log.output.io.rotate.RevolvingFileStrategy

    {
        deleteFiles( 9 );
        createFile( 0, 0 );
        createFile( 4, 0 );

        final RevolvingFileStrategy strategy =
            new RevolvingFileStrategy( m_baseFile, 9 );

        assertEquals( "rotation", 5, strategy.getCurrentRotation() );
    }
View Full Code Here

Examples of org.apache.log.output.io.rotate.RevolvingFileStrategy

    {
        deleteFiles( 9 );
        createFile( 0, OLD_AGE ); //Note this is oldest
        createFile( 4, 0 );

        final RevolvingFileStrategy strategy =
            new RevolvingFileStrategy( m_baseFile, 9 );

        assertEquals( "rotation", 5, strategy.getCurrentRotation() );
    }
View Full Code Here

Examples of org.apache.log.output.io.rotate.RevolvingFileStrategy

    {
        deleteFiles( 9 );
        createFile( 0, 0 );
        createFile( 4, OLD_AGE );

        final RevolvingFileStrategy strategy =
            new RevolvingFileStrategy( m_baseFile, 9 );

        assertEquals( "rotation", 5, strategy.getCurrentRotation() );
    }
View Full Code Here

Examples of org.apache.log.output.io.rotate.RevolvingFileStrategy

        createFile( 6, 0 );
        createFile( 7, 0 );
        createFile( 8, 0 );
        createFile( 9, 0 );

        final RevolvingFileStrategy strategy =
            new RevolvingFileStrategy( m_baseFile, 9 );

        assertEquals( "rotation", 0, strategy.getCurrentRotation() );
    }
View Full Code Here

Examples of org.apache.log.output.io.rotate.RevolvingFileStrategy

        createFile( 6, 0 );
        createFile( 7, OLD_AGE );
        createFile( 8, 0 );
        createFile( 9, 0 );

        final RevolvingFileStrategy strategy =
            new RevolvingFileStrategy( m_baseFile, 9 );

        assertEquals( "rotation", 7, strategy.getCurrentRotation() );
    }
View Full Code Here

Examples of org.apache.log.output.io.rotate.RevolvingFileStrategy

     */
    public void testSizeRevoling()
        throws Exception
    {
        final File file = new File( "test/size-revolve.log" );
        final FileStrategy fileStrategy = new RevolvingFileStrategy( file, 20 );
        final RotateStrategy rotateStrategy = new RotateStrategyBySize( 128 * 1024 );
        final Logger logger = getLogger( fileStrategy, rotateStrategy );

        doTest( logger );
    }
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.