anorm logback.xml“没有玩”

时间:2016-11-01 23:26:18

标签: scala anorm

是否可以配置anorm,当它使用没有播放框架进行日志记录(使用logback.xml fe)sql查询发送给db?< / p>

到目前为止,我尝试使用这些代码:

"mysql" % "mysql-connector-java" % "6.0.4",
"org.scalikejdbc" %% "scalikejdbc"       % "2.4.2",
"com.typesafe.play" %% "play-logback" % "2.5.3",
"ch.qos.logback"  %  "logback-core"   % "1.1.7",
"ch.qos.logback"  %  "logback-classic"   % "1.1.7",
"org.slf4j" % "slf4j-api" % "1.7.21",

"janino" % "janino" % "2.5.10"

那个conf:

<configuration>

    <!--<conversionRule conversionWord="coloredLevel" converterClass="play.api.libs.logback.ColoredLevel" />-->

    <appender name="FILE" class="ch.qos.logback.core.FileAppender">
        <file>logs/application.log</file>
        <encoder>
            <pattern>%date [%level] from %logger in %thread - %message%n%xException</pattern>
        </encoder>
    </appender>

    <appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
        <encoder>
            <pattern>%coloredLevel %logger{15} - %message%n%xException{10}</pattern>
        </encoder>
    </appender>

    <logger name="logger.org.jdbcdslog.StatementLogger"  level="DEBUG" />
   <logger name="anorm.jdbc.JdbcBackend.statement"  level="DEBUG" />

   <logger name="anorm" level="TRACE" />
   <logger name="anorm.SQL" level="TRACE" />


    <root level="INFO">
        <appender-ref ref="STDOUT" />
        <appender-ref ref="FILE" />
    </root>

</configuration>

我在日志中看到了一些信息,但没有看到SQL查询......

问:如何让Anorm打印sql查询?

现在我在log / deps中没有任何错误

在游戏中,我们可能会使用:db.default.logStatements=true

但如何不玩?

0 个答案:

没有答案