私はAkkaとAkka-httpを使って簡単なサーバーを開発しています。SLF4Jからのクラス「org.slf4j.impl.StaticLoggerBinder」のエラーを読み込めません
私はいつも、私はIntelliJのにアプリケーションを実行すると標準出力にエラーメッセージが表示され、次の取得:
SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder".
SLF4J: Defaulting to no-operation (NOP) logger implementation
SLF4J: See http://www.slf4j.org/codes.html#StaticLoggerBinder for further details.
私はbuild.gradleに次の依存関係があります。
compile 'org.scala-lang:scala-library:2.12.1'
compile 'com.typesafe.akka:akka-actor_2.12:2.4.17'
compile 'com.typesafe.akka:akka-stream_2.12:2.4.17'
compile 'com.typesafe.akka:akka-http_2.12:10.0.4'
compile 'com.typesafe.akka:akka-http-spray-json_2.12:10.0.4'
compile 'com.typesafe.akka:akka-slf4j_2.12:2.4.17'
をそして私はとapplication.confてきました以下のようになります。
最後に、このようなログを使用しています:
object HttpServer extends App with JsonSupport {
override def main(args: Array[String]): Unit = {
val config = ConfigFactory.load()
implicit val system = ActorSystem(config.getString("application.actor-system"))
implicit val materializer = ActorMaterializer()
// needed for the future flatMap/onComplete in the end
implicit val executionContext = system.dispatcher
val logger = Logging(system, getClass)
なぜ私はいつもそのエラー文を知ることができますか?
はい、動作します。私はそれを忘れていたと信じられない!ご協力いただきありがとうございます! –
これは私のために働いた - 警告を取り除いたが、代わりに私はいくつかの画面をデバッグと情報ログの価値がある。上記の答えのドキュメントリンクは、[この回答](https://stackoverflow.com/a/32003907)(基本的に 'logback.xml'を追加し、必要に応じて設定)と同様に役立ちます。 – fazy