Lenses follows the Twelve-Factor App approach: all logs are emitted unbuffered as a stream of events to both stdout and to rotating files inside the directory logs/. With Linux and Containers, one can integrate logging with the existing collection infrastructure.

The logback.xml file is used for logs. This file can be placedLenses starts, or

  • the directory where Lenses is stared from
  • /etc/lenses/
  • Lenses installation directory.

The first one found, in the above order, is used.

  • This file is monitored every 30 seconds and any changes are hot-reloaded.*

To set up a custom location using the relevant runtime environment:

export LENSES_LOG4J_OPTS="-Dlogback.configurationFile=file:mylogback.xml"

For debugging you can also use the logback-debug.xml file.

Log Level

The default log level is set to INFO (apart from some very verbose classes).

Log Format

All the log entries are written to the output using the following pattern:

%d{ISO8601} %-5p [%c{2}:%L] [%thread] %m%n

You can adjust this inside logback.xml to match your organization’s defaults.

Log Location

Under logs/ you will find three files: lenses.log, lenses-warn.log and metrics.log. The first contains all logs and is the same as the stdout. The second contains only messages at level WARN and above. The third one contains timing metrics and can be useful for debugging.