Categories: None [Edit]

contextualized_logs

https://rubygems.org/gems/contextualized_logs
https://github.com/babylist/contextualized_logs
Online logging solution (like [Datadog](https://www.datadoghq.com)) have drastically transform the way we log. An app will nowdays logs dozen (hundred) of logs per requests. The issue is often to correlate this logs, with the initiating request (or job) and add shared metadata on this logs. Here come `ContextualizedLogs`. The main idea is to enhance your logs from your controller (including `ContextualizedController`, which use a before action), which will add the params to your logs (and some metadata about the request itself, like `request.uuid`). This metadata are stored in a `ActiveSupport::CurrentAttributes` which is a singleton (reset per request). Each subsequent logs in this thread (request) will also be enriched with this metadata, making it easier to find all the logs associated with a request (`uuid`, `ip`, `params.xxx`). On top of this, logs can also be enriched by the ActiveRecord model they use (`create` or `find`) (models including `ContextualizedModel`). So any time a contextualized model is created or find, some metadata related to the model (`id`, ...) will also be added to the logs. Allowing you to find all logs which "touched" this models.

Total

Ranking: 67,592 of 182,301
Downloads: 13,129

Daily

Ranking: 97,722 of 182,287
Downloads: 0

Depended by

RankDownloadsName

Depends on

RankDownloadsName

Owners

#GravatarHandle
1iconrompelstilchen