1 23 24 package org.infoglue.cms.util; 25 26 import java.util.Date ; 27 import java.util.logging.Level ; 28 import java.util.logging.LogRecord ; 29 import java.util.logging.SimpleFormatter ; 30 31 34 35 public class CmsSimpleFormatter extends SimpleFormatter 36 { 37 public final String format(LogRecord record) 38 { 39 StringBuffer sb = new StringBuffer (); 40 String addition= ""; 41 if(record.getLevel() == Level.INFO) 42 addition = " "; 43 else if(record.getLevel() == Level.WARNING) 44 addition = " "; 45 else if(record.getLevel() == Level.SEVERE) 46 addition = " "; 47 48 sb.append(record.getLevel()).append(addition).append(new Date (record.getMillis()).toString()).append(" ").append(record.getMessage()).append('\n'); 49 return sb.toString(); 50 } 51 52 } 53 | Popular Tags |