/*
 * Copyright 2000-2004 The Apache Software Foundation.
 *
 * Licensed under the Apache License, Version 2.0 (the "License")
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

import org.apache.velocity.app.VelocityEngine;
import org.apache.velocity.runtime.RuntimeConstants;

import org.apache.log4j.Logger;
import org.apache.log4j.BasicConfigurator;


/**
 *  Simple example class to show how to use an existing Log4j Logger
 *  as the Velocity logging target.
 *
 * @author <a href="mailto:geirm@apache.org">Geir Magnusson Jr.</a>
 * @version $Id$
 */
public class Log4jLoggerExample
{
    public static String LOGGER_NAME = "velexample";

    public static void main( String args[] )
        throws Exception
    {
        /*
         *  configure log4j to log to console
         */

        BasicConfigurator.configure();

        Logger log = Logger.getLogger( LOGGER_NAME );

        log.info("Hello from Log4jLoggerExample - ready to start velocity");

        /*
         *  now create a new VelocityEngine instance, and
         *  configure it to use the logger
         */

        VelocityEngine ve = new VelocityEngine();

        ve.setProperty( RuntimeConstants.RUNTIME_LOG_LOGSYSTEM_CLASS,
            "org.apache.velocity.runtime.log.SimpleLog4JLogSystem" );

        ve.setProperty("runtime.log.logsystem.log4j.category", LOGGER_NAME);

        ve.init();

        log.info("this should follow the initialization output from velocity");
    }
}


@@ -17,17 +17,17 @@
 2000-200
-4
+5
  The Apa
@@ -713,16 +713,69 @@
 stants;%0A
+import org.apache.velocity.runtime.log.Log4JLogChute;
 %0Aimport 
@@ -843,17 +843,16 @@
 rator;%0A%0A
-%0A
 /**%0A *  
@@ -1269,33 +1269,32 @@
 ole%0A         */%0A
-%0A
         BasicCon
@@ -1355,17 +1355,16 @@
 tLogger(
- 
 LOGGER_N
@@ -1366,17 +1366,16 @@
 GER_NAME
- 
 );%0A%0A    
@@ -1572,17 +1572,16 @@
      */%0A
-%0A
         
@@ -1646,17 +1646,16 @@
 roperty(
- 
 RuntimeC
@@ -1704,16 +1704,27 @@
         
+           
 %22org.apa
@@ -1752,22 +1752,16 @@
 log.
-Simple
 Log4JLog
 Syst
@@ -1760,16 +1760,14 @@
 JLog
-System%22 
+Chute%22
 );%0A%0A
@@ -1793,46 +1793,46 @@
 rty(
-%22runtime.log.logsystem.log4j.category%22
+Log4JLogChute.RUNTIME_LOG_LOG4J_LOGGER
 , LO

use Log4jLogChute instead of deprecated SimpleLog4jLogSystem