Enable logging in Cinnamon

You may need to enable agent logging to debug Cinnamon configuration issues, for example.

Warning

Debug configuration is only meant for development and testing purposes and should not be used in production.

Agent log level configuration

The available log levels are TRACE, DEBUG, INFO, WARNING, ERROR, and MUTED. How you configure it depends on the build tool.

sbt

You can specify the cinnamonLogLevel sbt setting to provide loglevel to your Telemetry agent:

cinnamonLogLevel := "DEBUG"

Maven

Under maven, you can modify the <argument> tag that loads the Telemetry agent:

<argument>-javaagent:${project.build.directory}/dependency/cinnamon-agent.jar=loglevel=DEBUG</argument>

Gradle

Under gradle you can modify the jvmArgs attribute that loads the Telemetry agent:

jvmArgs "-javaagent:${configurations.agent.singleFile}=loglevel=DEBUG"

See sbt, Maven, or Gradle documentation for more details or agent configuration.

Enable Akka logging

Lightbend Telemetry uses Akka for logging, so it is necessary to activate Akka Logging too:

akka {
  stdout-loglevel = DEBUG
  loglevel = DEBUG
}

However, there are case where it uses an internal implementation that outputs to stdout, hence the existence of cinnamonLogLevel setting.

Enable debug = on for the specific module

For example, if you are using Elasticsearch reporter, add the following configuration in your application.conf:

cinnamon.chmetrics.elasticsearch-reporter.debug = on

Enable logging in logback.xml or any other logging backend in use

Again, if you are using Elasticsearch reporter, add a logger configuration entry with DEBUG level:

<configuration>
  <appender name="console" class="ch.qos.logback.core.ConsoleAppender">
    <encoder>
      <pattern>%d{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n</pattern>
    </encoder>
  </appender>

  <logger name="com.lightbend.cinnamon.chmetrics.elasticsearch" level="DEBUG" />

  <root level="INFO">
    <appender-ref ref="console"/>
  </root>
</configuration>