---
updatedAt: 2025-04-23T20:29:35.000Z
agentTools:
  projectIndex: https://silhouette.readme.io/llms.txt
---

# Logging

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

## Configure logging

> 📘 Note
>
> Play uses [Logback] as its logging framework. Please see the [Play documentation] on how to configure base logging in Play.
>
> [Logback]: http://logback.qos.ch/
>
> [Play documentation]: https://www.playframework.com/documentation/2.5.x/SettingsLogger

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.

```xml
<configuration debug="false">
    ...
    <logger name="com.mohiva" level="ERROR" />
    <logger name="com.mohiva.play.silhouette.api.Silhouette" level="INFO" />
    ...
</configuration>
```

## 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].

[Play logging API]: https://www.playframework.com/documentation/2.5.x/ScalaLogging

```scala
import com.mohiva.play.silhouette.core.Logger

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