Silhouette uses named loggers for logging. This gives your application fine-grained control over the log entries logged by Silhouette.

Configure logging



Play uses Logback as its logging framework. Please see the Play documentation on how to configure base logging in Play.

As an example, in your logging.xml you can set the logging level for the complete com.mohiva namespace to ERROR and then define a more detailed level for some components.

<configuration debug="false">
    <logger name="com.mohiva" level="ERROR" />
    <logger name="" level="INFO" />

Use the logger

To use the named logger you only need to mix the Logger trait into your class or trait. Then you can use the logger property to access the Play logging API.


class LoggerExample extends Logger {
  def log {
    logger.error("My log message")

What’s Next