1 16 17 import org.apache.velocity.app.Velocity; 18 import org.apache.velocity.runtime.log.LogSystem; 19 import org.apache.velocity.runtime.RuntimeServices; 20 21 22 33 public class LoggerExample implements LogSystem 34 { 35 public LoggerExample() 36 { 37 try 38 { 39 43 44 Velocity.setProperty(Velocity.RUNTIME_LOG_LOGSYSTEM, this ); 45 Velocity.init(); 46 47 52 } 53 catch( Exception e ) 54 { 55 System.out.println("Exception : " + e); 56 } 57 } 58 59 63 public void init( RuntimeServices rs ) 64 { 65 return; 66 } 67 68 72 public void logVelocityMessage(int level, String message) 73 { 74 System.out.println("level : " + level + " msg : " + message); 75 } 76 77 public static void main(String [] args) 78 { 79 LoggerExample t = new LoggerExample(); 80 } 81 } 82 | Popular Tags |