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.
logs/
The logback.xml file is used to configure logging, and a default optimized configuration is bundled with Lenses.
logback.xml
If customisation is required, it is recommended to adapt the default configuration rather than write your own from scratch.
The file can be placed in any of the following directories:
The first one found, in the above order, is used, but to override this and use a custom location set the following environment variable:
export LENSES_LOG4J_OPTS="-Dlogback.configurationFile=file:/path/to/logback.xml"
The default configuration file is set up to hot-reload any changes every 30 seconds.
The default log level is set to INFO (apart from some very verbose classes).
INFO
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.
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.
lenses.log
lenses-warn.log
metrics.log
The default configuration contains two cyclic buffer appenders named “CYCLIC-INFO” and “CYCLIC-METRICS”. These appenders are required to expose the Lenses logs within the Admin UI.
On this page