Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
929 views
in Technique[技术] by (71.8m points)

scala - Turn Slick logging off

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.

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"

It has zero effect. Can someone help me turn this logging off so I can once again like Slick?

Edit

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:
See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

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>

I found this somewhere in a Github project.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...