Logging
Last updated
Last updated
The processes running in the containers are configured to log to the console. The logs are saved to the disk using Docker's default JSON logging driver. Logging configuration is defined in each Compose file using YAML anchor syntax as shown below.
The logging is configured to facilitate log collection, shipping and feeding into log analytics solutions such as ELK, SumoLogic, Splunk, etc. In order to simplify this process, the role configures the following:
JSON format (where available)
Docker log tags
Docker labels
The clients are configured to log in JSON format if they support it which makes it easier to feed them into log analytics solutions without additional parsing.
Some clients generate multiline log entries. Multiline logs combined with Docker logging (which breaks down each line into a separate JSON object) poses a special challenge. Refer to our blog post describing this. The table below summarizes logging features of each client.
Client | JSON format | Multiline |
---|---|---|
Each Docker compose file contains a tag with details that are useful when managing the logs. The tag contains the following data:
layer (execution, consensus, validator)
client name
Docker image name
container name
Full ID of the image
Full ID of the container
Compose template
Rendered tag
Compose template
Rendered tag
Compose template
Rendered tag
The variables prefixed with dot (for example {{.ImageName}}) symbol are Docker variables and use the double curly braces syntax for substitution. See Docker documentation for details. Double curly braces {{ }} are treated by Jinja as variables and need to be escaped using {% raw %} {% endraw %} Jinja tag as shown below.
The containers have custom labels defined in the Compose files. There two tags that specify the "layer" and the "client". The labels are required to allow for selective log collection using Filebeat. Refer to our blog post for details.
SlingNode has developed an Ansible role that can deploy an Observability stack that seamlessly integrates with nodes deployed using slingnode.ethereum role. The role enables log parsing and forwarding to ElasticSearch.
Geth
yes
no
Erigon
yes
no
Besu
no
yes
Nethermind
no
yes
Lighthouse
yes
no
Prysm
yes
no
Teku
no
yes
Nimbus
yes
no