Author: nbubna Date: Mon Oct 10 10:20:21 2005 New Revision: 312688 URL: http://svn.apache.org/viewcvs?rev=312688&view=rev Log: use Log4jLogChute instead of deprecated SimpleLog4jLogSystem
Modified: jakarta/velocity/core/trunk/examples/logger_example/Log4jLoggerExample.java Modified: jakarta/velocity/core/trunk/examples/logger_example/Log4jLoggerExample.java URL: http://svn.apache.org/viewcvs/jakarta/velocity/core/trunk/examples/logger_example/Log4jLoggerExample.java?rev=312688&r1=312687&r2=312688&view=diff ============================================================================== --- jakarta/velocity/core/trunk/examples/logger_example/Log4jLoggerExample.java (original) +++ jakarta/velocity/core/trunk/examples/logger_example/Log4jLoggerExample.java Mon Oct 10 10:20:21 2005 @@ -1,5 +1,5 @@ /* - * Copyright 2000-2004 The Apache Software Foundation. + * Copyright 2000-2005 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. @@ -16,11 +16,10 @@ import org.apache.velocity.app.VelocityEngine; import org.apache.velocity.runtime.RuntimeConstants; - +import org.apache.velocity.runtime.log.Log4JLogChute; 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. @@ -38,10 +37,9 @@ /* * configure log4j to log to console */ - BasicConfigurator.configure(); - Logger log = Logger.getLogger( LOGGER_NAME ); + Logger log = Logger.getLogger(LOGGER_NAME); log.info("Hello from Log4jLoggerExample - ready to start velocity"); @@ -49,13 +47,12 @@ * 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(RuntimeConstants.RUNTIME_LOG_LOGSYSTEM_CLASS, + "org.apache.velocity.runtime.log.Log4JLogChute"); - ve.setProperty("runtime.log.logsystem.log4j.category", LOGGER_NAME); + ve.setProperty(Log4JLogChute.RUNTIME_LOG_LOG4J_LOGGER, LOGGER_NAME); ve.init(); --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]