Community contributed extensions



This very simple module enhances the Play! Framework logs to bring some missing information such as the class name, the method name where the log has been called, its signature, the file name and the line.

The latest version of this module can be fetched from github :

How To Use It


# Custom prefix (this is the default one)
betterlogs.prefix=[%relativeFile:%line] %method() ::
# Append 2 spaces at the end of the pattern

In your code, the following code“got %s messages from %s”, 2, “[email protected]”);

will give you

12:47:05,499 INFO ~ [/app/controllers/] index() :: got 2 messages from [email protected]

Pattern Elements

You can add the following elements to the prefix pattern :


You can disable BetterLogs with the betterlogs.disabled option :


If you enable or disable BetterLogs, do not forget to clean your app before restarting Play, to force the framework to enhance all the classes again.

Use With Log4J

This module just prepends a string matching the prefix pattern to log string. So it does not conflict with the log4j config file even if you redefine it.

Planned features