akka/akka-core

Log error message printed to stdout despite mute filter

Aperta

#25.057 aperta il 7 mag 2018

 (4 commenti) (0 reazioni) (0 assegnatari)Scala (3547 fork)batch import
1 - triagedhelp wantedt:testing

Metriche repository

Star
 (13.277 stelle)
Metriche merge PR
 (Merge medio 8g 19h) (10 PR mergiate in 30 g)

Descrizione

Using Akka version 2.5.11.

Have akka.loggers = ["akka.testkit.TestEventListener"] set in the application.conf and, before executing a test, do system.eventStream.publish(TestEvent.Mute(EventFilter.error())).

With this setup, I expect all calls to log.error to be muted. However, what I'm actually seeing is that calls to log.error(msg) are correctly muted, while calls to log.error(cause, msg) are not (!).

Below is the stacktrace for the log.error(cause, msg) call

at akka.event.Logging$StdOutLogger.print(Logging.scala:890)
	  at akka.event.Logging$StdOutLogger.print$(Logging.scala:889)
	  at akka.event.Logging$DefaultLogger.print(Logging.scala:1021)
	  at akka.testkit.TestEventListener$$anonfun$receive$1.applyOrElse(TestEventListener.scala:506)
	  at akka.actor.Actor.aroundReceive(Actor.scala:517)
	  at akka.actor.Actor.aroundReceive$(Actor.scala:515)
	  at akka.event.Logging$DefaultLogger.aroundReceive(Logging.scala:1021)
	  at akka.actor.ActorCell.receiveMessage(ActorCell.scala:590)
	  at akka.actor.ActorCell.invoke(ActorCell.scala:559)
	  at akka.dispatch.Mailbox.processMailbox(Mailbox.scala:257)
	  at akka.dispatch.Mailbox.run(Mailbox.scala:224)
	  at akka.dispatch.Mailbox.exec(Mailbox.scala:234)
	  at akka.dispatch.forkjoin.ForkJoinTask.doExec(ForkJoinTask.java:260)
	  at akka.dispatch.forkjoin.ForkJoinPool$WorkQueue.runTask(ForkJoinPool.java:1339)
	  at akka.dispatch.forkjoin.ForkJoinPool.runWorker(ForkJoinPool.java:1979)
	  at akka.dispatch.forkjoin.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:107)

and this codepath is not hit when calling log.error(msg).

Let me know if you can't pinpoint the issue and I should have some time next week to create a full reproducible

Guida contributor