Skip to content

Commit 2552151

Browse files
committed
Logging creating of akka http system
1 parent 4cf488d commit 2552151

File tree

1 file changed

+14
-5
lines changed

1 file changed

+14
-5
lines changed

src/main/scala/com/thenewmotion/akka/http/AkkaHttp.scala

+14-5
Original file line numberDiff line numberDiff line change
@@ -12,16 +12,25 @@ trait AkkaHttp {
1212
private[http] var _actorSystem: Option[ActorSystem] = None
1313

1414
private[http] def initAkkaSystem() {
15-
_actorSystem = Some(newHttpSystem())
16-
onSystemInit(_actorSystem.get)
15+
val system = newHttpSystem()
16+
_actorSystem = Some(system)
17+
onSystemInit(system)
18+
system.log.info("Akka Http System '{}' created", system)
19+
logConfigOnInit()
20+
}
21+
22+
private[http] def logConfigOnInit() {
23+
_actorSystem.foreach {
24+
system =>
25+
val ext = HttpExtension(system)
26+
if (ext.LogConfigOnInit) ext.logConfiguration()
27+
}
1728
}
1829

1930
protected def newHttpSystem(): ActorSystem = {
2031
val name = ConfigFactory.load().getString("akka.http.system-name")
2132
val system = ActorSystem(name)
22-
val ext = HttpExtension(system)
23-
system.actorOf(Props[EndpointsActor], ext.EndpointsName)
24-
if (ext.LogConfigOnInit) ext.logConfiguration()
33+
system.actorOf(Props[EndpointsActor], HttpExtension(system).EndpointsName)
2534
system
2635
}
2736

0 commit comments

Comments
 (0)