[SOLVED] Slf4j Logger neither print to console nor file

When setting up a sbt project, I use following code and configuration.

build.sbt

name := "mypkg"
scalaVersion := "2.12.10"
libraryDependencies ++= Seq(
  "org.slf4j" % "slf4j-api" % "1.7.28",
  "org.slf4j" % "slf4j-nop" % "1.7.28"
)
assemblyMergeStrategy in assembly := {
  case PathList("javax", "servlet", xs @ _*)           => MergeStrategy.first
  case "application.conf"                              => MergeStrategy.concat
  case x =>
     val oldStrategy = (assemblyMergeStrategy in assembly).value
    oldStrategy(x)
}

project/plusgins.sbt

addSbtPlugin("com.eed3si9n" % "sbt-assembly" % "0.14.10")

src/main/scala/mypackage/App.scala

package mypkg

import org.slf4j.LoggerFactory

trait MyLog {
  val log = LoggerFactory.getLogger(getClass)
}

object App extends MyLog {
  def main(args: Array[String]) {
    println("before log print")
    log.info("test!")
    println("after log print")
  }
}

src/main/resources/log4j.properties

log4j.rootLogger=INFO, file, stdout

log4j.appender.file=org.apache.log4j.RollingFileAppender
log4j.appender.file.File=/tmp/test.log
log4j.appender.file.MaxFileSize=12MB
log4j.appender.file.layout=org.apache.log4j.PatternLayout
log4j.appender.file.layout.ConversionPattern=%d{yyyy-MM-dd HH:mm:ss} %-5p %c{1}:%L - %m%n

log4j.appender.stdout=org.apache.log4j.ConsoleAppender
log4j.appender.stdout.Target=System.out
log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
log4j.appender.stdout.layout.ConversionPattern=%d{yyyy-MM-dd HH:mm:ss} %-5p %c{1}:%L - %m%n

Command

scala -cp ./:./target/scala-2.12/mypkg-assembly-0.1.0-SNAPSHOT.jar mypkg.App

Output in console

before log print
after log print

However log neither’t get printed in console nor in file. Which part do I need to fix so that log can print to console and write msg to file?

Thanks

Ok I found the reason why. I should use (in build.sbt)

"org.slf4j" % "slf4j-simple" % "1.7.28"

instead of

"org.slf4j" % "slf4j-nop" % "1.7.28"

The problem is fixed.