1 14 15 package org.quickserver.util.logging; 16 17 import java.util.Date ; 18 import java.util.logging.*; 19 20 23 public class MicroFormatter extends Formatter { 24 private String lineSeparator = (String ) java.security.AccessController.doPrivileged( 25 new sun.security.action.GetPropertyAction("line.separator")); 26 27 public String format(LogRecord record) { 28 StringBuffer sb = new StringBuffer (); 29 sb.append(record.getLevel().getLocalizedName()); 30 sb.append(" : "); 31 sb.append(formatMessage(record)); 32 if(record.getThrown() != null) { 33 sb.append(lineSeparator); 34 sb.append("[Exception: "); 35 sb.append(record.getThrown().toString()); 36 sb.append(']'); 37 } 38 sb.append(lineSeparator); 39 return sb.toString(); 40 } 41 } 42 | Popular Tags |