class LogFormatter extends Formatter {

    private static final String DEFAULT_FORMAT = "%1$tb %1$td, %1$tY %1$tl:%1$tM:%1$tS %1$Tp %2$s%n%4$s: %5$s%6$s%n";

    private final String format;
    private final String version;

    public LogFormatter() {
        this(DEFAULT_FORMAT, "unknown");
    }

    public LogFormatter(String format, String version) {
        this.format = format;
        this.version = version;
    }

    @Override
    @SuppressWarnings("deprecation")
    public String format(LogRecord logRecord) {<FILL_FUNCTION_BODY>}

    private String className(String className) {
        return className.substring(className.lastIndexOf('.') + 1);
    }
}

        Date dat = new Date(logRecord.getMillis());
        StringBuilder source = new StringBuilder();
        if (logRecord.getSourceClassName() != null) {
            source.append(logRecord.getSourceClassName());
            if (logRecord.getSourceMethodName() != null) {
                source.append(' ').append(logRecord.getSourceMethodName());
            }
        } else {
            source.append(logRecord.getLoggerName());
        }

        StringBuilder throwable = new StringBuilder();
        if (logRecord.getThrown() != null) {
            StringWriter sw = new StringWriter();
            PrintWriter pw = new PrintWriter(sw);
            pw.println();
            logRecord.getThrown().printStackTrace(pw);
            pw.close();
            throwable.append(sw.toString());
        }

        return String.format(format,
                dat,                                   //%1
                source.toString(),                     //%2
                logRecord.getLoggerName(),                //%3
                logRecord.getLevel().getLocalizedName(),  //%4
                formatMessage(logRecord),                 //%5
                throwable,                             //%6 (till here the same as JDK7's SimpleFormatter)
                logRecord.getSourceClassName(),           //%7
                logRecord.getSourceMethodName(),          //%8
                className(logRecord.getSourceClassName()), //%9
                logRecord.getThreadID(),                  //%10
                logRecord.getMessage(),                   //%11
                version
                );
    
<methods>public abstract java.lang.String format(java.util.logging.LogRecord) ,public java.lang.String formatMessage(java.util.logging.LogRecord) ,public java.lang.String getHead(java.util.logging.Handler) ,public java.lang.String getTail(java.util.logging.Handler) <variables>