A set of libraries to transform your Ruby application logs to structured logs that comply with the Elastic Common Schema (ECS).
ECS logs are designed to be ingested by Elasticsearch via Filebeat or other collectors, and leveraged in Kibana.
Add this line to your application's Gemfile:
gem 'ecs-logging'And then execute:
$ bundle installFull documentation is built with Zensical and available in the docs/ directory.
The docs are also published as a container image to GitHub Container Registry:
ghcr.io/damacus/ecs-logging-ruby-docs:latest
require 'ecs_logging/logger'
logger = EcsLogging::Logger.new($stdout)
logger.info("Hello world!")
# => {"@timestamp":"2021-02-09T12:00:00.000Z","log.level":"INFO","message":"Hello world!","ecs.version":"8.11.0"}require 'ecs_logging/middleware'
use EcsLogging::Middleware, $stdoutApache 2.0