Even with the simple JDK protocol, you can use Formatter to handle formatting of log messages with parameters.
For a (simplified) example:
public class MyFormatter extends Formatter { @Override public String format(final LogRecord record) { return MessageFormat.format(record.getMessage(), record.getParameters()); } }
Then, to use it, you can configure the logging.properties file with:
java.util.logging.ConsoleHandler.formatter = com.example.MyFormatter
source share