Slick logging with slf4j-simple

人走茶凉 提交于 2019-12-06 13:42:50

问题


I am using slf4j-simple in my project. I would like to change logging level for slick to INFO. After reading Logging options for Slick and Class SimpleLogger docsI have tried to add following options to my VM line:

-Dorg.slf4j.simpleLogger.defaultLogLevel=INFO
-Dlogger.scala.slick=INFO
-Dlogger.scala.slick.jdbc.JdbcBackend.statement=INFO
-Dorg.slf4j.simpleLogger.log.scala.slick=INFO

I see a few INFO level logs comming from jetty, therefore the basic logging seems to be working. I am also able to change level of logs shown by using -Dorg.slf4j.simpleLogger.defaultLogLevel=TRACE, but even that only shows more jetty logs, no Slick logs are shown to me.

How can I configure slf4j-simple to shown slick logs to me?


回答1:


According to http://www.slf4j.org/api/org/slf4j/impl/SimpleLogger.html the correct system property should be

-Dorg.slf4j.simpleLogger.log.scala.slick=debug

instead of

-Dlogger.scala.slick=INFO 

For reference, the list of all loggers used by Slick can be found in logback.xml. We only use the debug level with all of them.



来源:https://stackoverflow.com/questions/23870226/slick-logging-with-slf4j-simple

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!