import java.util.logging.Handler;
import java.util.logging.LogRecord;
public class HTMLTableFormatter extends java.util.logging.Formatter {
public String format(LogRecord record) {
return (" <tr><td>" + record.getMillis() + "</td><td>"
+ record.getMessage() + "</td></tr>\n");
}
public String getHead(Handler h) {
return ("<table border>\n "
+ "<tr><th>Time</th><th>Log Message</th></tr>\n");
}
public String getTail(Handler h) {
return ("</table>\n");
}
}
|