我需要一个ActorSystem,不记录任何东西。用spray尝试HTTP的东西,我太笨了,忍不住复制粘贴他们的示例代码here。正如您所看到的,他们使用的是ActorSystem,其默认配置将标准输出与一大堆信息搞得一团糟。那么,如何制作符合我需求的ActorSystem呢?如果它可以在没有任何外部XML或配置文件的情况下完成,我会喜欢这种方式。Thank you!:)
ActorSystem
ca1c2owp1#
import spray.http._import spray.client.pipelining._import akka.actor.ActorSystemimport com.typesafe.config._val config = ConfigFactory.load() .withValue("akka.loglevel", ConfigValueFactory.fromAnyRef("OFF")) .withValue("akka.stdout-loglevel", ConfigValueFactory.fromAnyRef("OFF"))implicit val system = ActorSystem("AlwaysNameYourSystem", config)import system.dispatcher // execution context for futures// ... here goes the rest of example code
import spray.http._
import spray.client.pipelining._
import akka.actor.ActorSystem
import com.typesafe.config._
val config = ConfigFactory.load()
.withValue("akka.loglevel", ConfigValueFactory.fromAnyRef("OFF"))
.withValue("akka.stdout-loglevel", ConfigValueFactory.fromAnyRef("OFF"))
implicit val system = ActorSystem("AlwaysNameYourSystem", config)
import system.dispatcher // execution context for futures
// ... here goes the rest of example code
这里发生了什么
在这一点上,你不应该看到任何消息,在系统启动和任何喷雾通知
qncylg1j2#
这个在**.conf**中的配置对我来说也是有效的
akka { # Log the complete configuration at INFO level when the actor system is started. # This is useful when you are uncertain of what configuration is used. log-config-on-start = off}
akka {
# Log the complete configuration at INFO level when the actor system is started.
# This is useful when you are uncertain of what configuration is used.
log-config-on-start = off
}
文档在此
2条答案
按热度按时间ca1c2owp1#
这里发生了什么
ActorSystem
(文档在此)。在这一点上,你不应该看到任何消息,在系统启动和任何喷雾通知
qncylg1j2#
这个在**.conf**中的配置对我来说也是有效的
文档在此