나는 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