CustomFormatter.java Source code

Java tutorial

Introduction

Here is the source code for CustomFormatter.java

Source

import java.util.logging.Formatter;
import java.util.logging.LogRecord;

public class CustomFormatter extends Formatter {
    public synchronized String format(LogRecord record) {
        String methodName = record.getSourceMethodName();
        String message = record.getMessage();
        StringBuffer buffer = new StringBuffer(50);
        buffer.append(methodName);
        buffer.append("=");
        buffer.append(message);
        return buffer.toString();
    }
}