Laconic Log FormatterPosted by Roger Keays, 19 February 2009, 1:10 PM |
/**
* Formats log messages onto one line only with only the time, level and
* message. The date is ommitted because the log files are rotated daily
* anyway.
*/
public class LaconicFormatter extends Formatter {
@Override
public String format(LogRecord record) {
return new SimpleDateFormat("HH:mm:ss ").format(
new Date(record.getMillis())) +
record.getLevel().getName().substring(0, 4) + " " +
record.getMessage() + "\n";
}
}
| << Monitoring the JVM with SNMP + MRTG | Back to Blog | Fluid CSS Menus and Sub-Pixel Workaround >> |