I\'m using Play 2.1. I\'m using the default logger play.api.Logger. I\'m confused about how it works.
In my scala code, a line in class \"com.myapp.tickets\" in th
Since Play's Logger wraps the underlying SLF4J calls, the logger class is always "application":
13:45:21 INFO application: - Some message
But there is an easy way round this.
Create a trait:
import play.api.Logger
trait WithLogging {
val logger: Logger = Logger(this.getClass())
}
And in your classes just mix in the trait:
import WithLogging
class Foobarr extends WithLogging {
def doFoo = {
logger.info("Im in foooo")
}
}
Now this should be:
13:45:21 INFO models.Foobarr: - Im in foooo