Logging options for Slick

前端 未结 8 1756
抹茶落季
抹茶落季 2020-12-16 13:33

I\'m createing a Play 2.1 app, in which I have decided to use Slick for database interaction.
However I can\'t find documentation about how to configure/enable logging f

8条回答
  •  北荒
    北荒 (楼主)
    2020-12-16 13:57

    For PlayFramework 2.5.0 without Slick

    Add to all your database configurations

    db.default.logSql=true
    

    Add to your logback.xml file:

     
    

    All the statements will be logged.

    Reference:

    https://www.playframework.com/documentation/2.5.x/ScalaDatabase#How-to-configure-SQL-log-statement

    For play with Slick 3.0, just use

     
    

提交回复
热议问题