Hi,
heres a patch to update to latest version of logkit. I am not subscibed to
this so if there is any issues cc me individually ;)
Index: AvalonLogSystem.java
===================================================================
RCS file:
/home/cvspublic/jakarta-velocity/src/java/org/apache/velocity/runtime/log/Av
alonLogSystem.java,v
retrieving revision 1.4
diff -u -w -r1.4 AvalonLogSystem.java
--- AvalonLogSystem.java 2001/04/08 21:58:29 1.4
+++ AvalonLogSystem.java 2001/05/05 03:46:04
@@ -58,11 +58,10 @@
import java.net.URL;
-import org.apache.log.Category;
import org.apache.log.Formatter;
import org.apache.log.Priority;
import org.apache.log.Logger;
-import org.apache.log.LogKit;
+import org.apache.log.Hierarchy;
import org.apache.log.LogTarget;
import org.apache.log.output.FileOutputLogTarget;
@@ -121,16 +120,6 @@
public void init(String logFile)
throws Exception
{
- String targetName = "velocity";
- String priority = "DEBUG";
-
- Category category = LogKit.createCategory(
- targetName, LogKit.getPriorityForName( priority ) );
-
- /*
- * Just create a FileOutputLogTarget, this is taken
- * from the SAR deployer in Avalon.
- */
FileOutputLogTarget target = new FileOutputLogTarget();
File logFileLocation = new File (logFile);
@@ -139,15 +128,10 @@
target.setFilename( logPath );
target.setFormatter(new VelocityFormatter());
target.setFormat("%{time} %{message}\\n%{throwable}" );
-
- LogTarget logTargets[] = null;
-
- if ( null != target )
- {
- logTargets = new LogTarget[] { target };
- }
- logger = LogKit.createLogger( category, logTargets );
+ logger = Hierarchy.getDefaultHierarchy().getLoggerFor( "velocity" );
+ logger.setPriority( Priority.DEBUG );
+ logger.setLogTargets( new LogTarget[] { target } );
}
/**
log.jar
Cheers,
Pete
*-----------------------------------------------------*
| "Faced with the choice between changing one's mind, |
| and proving that there is no need to do so - almost |
| everyone gets busy on the proof." |
| - John Kenneth Galbraith |
*-----------------------------------------------------*