Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
926 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 Answer

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.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...