akka/akka-core

Log error message printed to stdout despite mute filter

開放

#25,057 建立於 2018年5月7日

 (4 則留言) (0 個反應) (0 位負責人)Scala (3,547 個分叉)batch import
1 - triagedhelp wantedt:testing

倉庫指標

星標
 (13,277 顆星)
PR 合併指標
 (平均合併 8天 19小時) (30 天內合併 10 個 PR)

描述

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

貢獻者指南