关闭 Slick 登录 [英] Turn Slick logging off
问题描述
Slick 用大量日志消息填满了控制台.我想,就像文档建议的那样,使用 slf4j-nop
,所以日志记录被关闭,但 Akka 需要它自己的 slf4j 库.
Slick fills up the console with a massive amount of log messages. I wanted, like the documentation suggested, to use slf4j-nop
, so logging is turned off, but Akka needs its own slf4j library.
所以我留下了 Slick 也使用的 akka-slf4j_2.10
.我尝试了很多东西.包含在我的 application.conf
中的是这个(尝试使用和不使用 "):
So I'm left with akka-slf4j_2.10
that Slick also uses. I've tried many things. Included in my application.conf
is this (tried with and without "):
logger="OFF"
logger.scala.slick="OFF"
logger.scala.slick.session="OFF"
logger.scala.slick.jdbc.JdbcBackend.statement="OFF"
logger.scala.slick.jdbc="OFF"
它的效果为零.有人可以帮我关闭此日志记录以便我再次喜欢 Slick 吗?
It has zero effect. Can someone help me turn this logging off so I can once again like Slick?
我收到的一些日志消息:
Some of the log messages I get:
17:16:56.706 [seating-akka.actor.default-dispatcher-8] DEBUG scala.slick.ast.Node$ - Assigned type Int/INTEGER to node InsertColumn SEAT_ID
17:16:56.710 [seating-akka.actor.default-dispatcher-8] DEBUG scala.slick.compiler.QueryCompiler - After phase insertCompiler:
推荐答案
我已经通过向 src/main/resources
添加一个 logback.xml
来修复它:
I've fixed it by adding a logback.xml
to src/main/resources
:
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<logger name="scala.slick" level="INFO" />
</configuration>
这篇关于关闭 Slick 登录的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!