kamon-io / sbt-aspectj-runner

sbt plugin for running aspectj weaver
Other
34 stars 16 forks source link

Play 2.4 application.conf does not override kamon reference.conf values. #5

Open ozgunatacan opened 8 years ago

ozgunatacan commented 8 years ago

Play 2.4, kamon 0.6.0, aspectj-play-runner 0.1.3

When I start play application using aspectj-runner:play-run somehow the changes in appplication.conf file for kamon are disregarded.

It is fine if I start the app with sbt:run

marklieberman commented 8 years ago

I am having a similar issue.

When running with aspectj-runner, some Kamon modules do not seem to get config from application.conf unless I manually specify the config file on the command line like so: activator aspectj-runner:run -Dconfig.file=conf/application.conf.

I'm doing the following in my application.conf

kamon {
  internal-config {
    akka {
      loggers = [ "akka.event.slf4j.Slf4jLogger" ]
      loglevel = "INFO"
    }
  }
}

When I run like so:

activator aspectj-runner:run
-->
...snip...
[info] Kamon at [Play] - Initializing Kamon...
[info] Kamon at [Play] - Trying to load kamon-autoweave...
[INFO] [07/08/2016 11:23:28.682] [ForkJoinPool-1-worker-1] [StatsDExtension(akka://kamon)] Starting the Kamon(StatsD) extension
[INFO] [07/08/2016 11:23:28.807] [ForkJoinPool-1-worker-1] [SystemMetricsExtension(akka://kamon)] Starting the Kamon(SystemMetrics) extension
[info] k.s.SigarProvisioner at [Play] - Sigar library provisioned: ...
...snip...

Why arent kamon-system-metrics and kamon-statsd using my configured logging interface? It not just logging - kamon-statsd didn't get my statsd hostname either, so no metrics are reported.

However, when I run like so:

activator aspectj-runner:run -Dconfig.file=conf/application.conf
-->
...snip...
[info] Kamon at [Play] - Initializing Kamon...
[info] Kamon at [Play] - Trying to load kamon-autoweave...
[info] k.s.StatsDExtension at [StatsDExtension(akka://kamon)] - Starting the Kamon(StatsD) extension
[info] k.s.SystemMetricsExtension at [SystemMetricsExtension(akka://kamon)] - Starting the Kamon(SystemMetrics) extension
[info] k.s.SigarProvisioner at [Play] - Sigar library provisioned: ...
...snip...

Look, they are using my logging interface now.

Adding the option in build.sbt appears to work too:

// Select the configuration file in DEV mode.
javaOptions += "-Dconfig.file=conf/application.conf"

I am using: kamon-play-24, kamon-akka, kamon-system-metrics, kamon-statsd.