Package org.apache.velocity.runtime.log
Class LogManager
- java.lang.Object
-
- org.apache.velocity.runtime.log.LogManager
-
public class LogManager extends java.lang.Object
This class is responsible for instantiating the correct LogChute
The approach is :
- First try to see if the user is passing in a living object that is a LogChute, allowing the app to give its living custom loggers.
- Next, run through the (possible) list of classes specified specified as loggers, taking the first one that appears to work. This is how we support finding logkit, log4j or jdk logging, whichever is in the classpath and found first, as all three are listed as defaults.
- Finally, we turn to the System.err stream and print log messages to it if nothing else works.
- Version:
- $Id: LogManager.java 991708 2010-09-01 21:17:56Z nbubna $
-
-
Constructor Summary
Constructors Constructor Description LogManager()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description private static LogChute
createLogChute(RuntimeServices rsvc)
private static boolean
isProbablyProvidedLogChute(java.lang.String claz)
Simply tells whether the specified classname probably is provided by Velocity or is implemented by someone else.static void
updateLog(Log log, RuntimeServices rsvc)
Update the Log instance with the appropriate LogChute and other settings determined by the RuntimeServices.
-
-
-
Method Detail
-
createLogChute
private static LogChute createLogChute(RuntimeServices rsvc) throws java.lang.Exception
- Throws:
java.lang.Exception
-
isProbablyProvidedLogChute
private static boolean isProbablyProvidedLogChute(java.lang.String claz)
Simply tells whether the specified classname probably is provided by Velocity or is implemented by someone else. Not surefire, but it'll probably always be right. In any case, this method shouldn't be relied upon for anything important.
-
updateLog
public static void updateLog(Log log, RuntimeServices rsvc) throws java.lang.Exception
Update the Log instance with the appropriate LogChute and other settings determined by the RuntimeServices.- Parameters:
log
-rsvc
-- Throws:
java.lang.Exception
- Since:
- 1.5
-
-