Package org.apache.log.output.io

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


            //Specify output location for logging
            final File file = new File( m_baseDirectory, location );

            //Setup logtarget
            FileTarget logTarget = null;
            try
            {
                logTarget = new FileTarget( file.getAbsoluteFile(), append, formatter );
            }
            catch( final IOException ioe )
            {
                final String message =
                    REZ.getString( "target.nocreate", name, file, ioe.getMessage() );
View Full Code Here


        try
        {
            if( null == confRotation )
            {
                logtarget = new FileTarget( file, append, formatter );
            }
            else
            {
                if( confRotation.getChildren().length == 0 )
                {
View Full Code Here

            m_logTarget = new StreamTarget( System.out, formatter );
        }
        else
        {
            final File file = new File( logDestination );
            m_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();
View Full Code Here

        {
            VelocityFormatter vf =
                new VelocityFormatter("%{time} %{message}\\n%{throwable}");

            // make the target and keep the default behavior of not appending
            FileTarget target = new FileTarget(new File(file), false, vf);

            logger.setPriority(Priority.DEBUG);
            logger.setLogTargets(new LogTarget[] { target });
            log(DEBUG_ID, "AvalonLogChute initialized using file '"+file+'\'');
        }
View Full Code Here

            parameters.getParameter( "log-destination", phoenixHome + DEFAULT_LOG_FILE );
        final String logPriority =
            parameters.getParameter( "log-priority", "INFO" );
        final AvalonFormatter formatter = new AvalonFormatter( DEFAULT_FORMAT );
        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" );
View Full Code Here

            parameters.getParameter( "log-destination", phoenixHome + DEFAULT_LOG_FILE );
        final String logPriority =
            parameters.getParameter( "log-priority", "INFO" );
        final AvalonFormatter formatter = new AvalonFormatter( DEFAULT_FORMAT );
        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" );
View Full Code Here

            //Specify output location for logging
            final File file = new File( m_baseDirectory, location );

            //Setup logtarget
            FileTarget logTarget = null;
            try
            {
                logTarget = new FileTarget( file.getAbsoluteFile(), false, formatter );
            }
            catch( final IOException ioe )
            {
                final String message =
                    REZ.getString( "target.nocreate", name, file, ioe.getMessage() );
View Full Code Here

  /*
   *  make our FileTarget.  Note we are going to keep the
   *  default behavior of not appending...
   */
        FileTarget target = new FileTarget( new File( logFile),
              false,
              new VelocityFormatter("%{time} %{message}\\n%{throwable}" ) );
      
        /*
         *  use the toString() of RuntimeServices to make a unique logger
View Full Code Here

            }

            VelocityFormatter vf = new VelocityFormatter(format);

            // make the target and keep the default behavior of not appending
            FileTarget target = new FileTarget(new File(file), false, vf);

            logger.setPriority(level);
            logger.setLogTargets(new LogTarget[] { target });
            log(DEBUG_ID, "AvalonLogChute initialized using file '"+file+'\'');
        }
View Full Code Here

    }

    public void testFileTarget()
        throws Exception
    {
        final FileTarget target = new FileTarget( m_logFile, false, FORMATTER );

        final Logger logger = getNewLogger( target );
        logger.debug( M1 );
        logger.debug( M2 );
        logger.debug( M3 );
        target.close();

        final String data = getFileContents( m_logFile );
        assertEquals( "Targets file output", OUTPUT, data );
        assertTrue( "Deleting logfile", m_logFile.delete() );
View Full Code Here

TOP

Related Classes of org.apache.log.output.io.FileTarget

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.