Nebo15/logger_json
66.3
Adequate · 18 September 2026
1.9k
lines of production code
Elixir
primary language
1
measurement over time
What this system is
LoggerJSON is an Elixir library that provides structured JSON log formatters for various cloud platforms and observability tools. It integrates with Ecto and Plug via telemetry to log database queries and HTTP requests, while supporting runtime log level configuration and sensitive data redaction. The system is built on a modern formatter architecture compatible with Elixir 1.18+ and includes performance benchmarks to measure encoding overhead.
How it got here
2017 — Elixir 1.16+ modernization and telemetry integration
8 changes.
The project underwent a significant modernization to support Elixir 1.16+ and later 1.18+, involving a major dependency overhaul and the removal of legacy tools. New features were introduced, including runtime log level configuration and dedicated telemetry integrations for Ecto and Plug, alongside comprehensive test coverage updates.
2024–2025 — formatter architecture rewrite
6 changes.
The project refactored its internal architecture by replacing legacy logger backends with a new formatter-based system, introducing dedicated modules for various output formats like Datadog, ECS, and Google Cloud. This restructuring aligned the library with modern Elixir and Erlang standards while improving performance and maintainability. Comprehensive test suites and performance benchmarks were added to verify the correctness and efficiency of the new formatter components.
Features
Initial project setup with formatter, license, and documentation
The repository is initialized with a standard Elixir project structure, including a \.formatter.exs\ file for code formatting, a \LICENSE.md\ file adopting the MIT license, and a \\_config.yml\ for Jekyll documentation hosting. The \README.md\ is rewritten to document LoggerJSON as a collection of JSON-based log formatters for various cloud platforms (Basic, Google Cloud, Datadog, Elastic), providing installation instructions for version 7.0 and configuration examples using the new \new/1\ API. Additionally, \.gitignore\ is updated to exclude package tarballs and temporary test files, and \coveralls.json\ is adjusted to stop skipping the \tasks.ex\ file.
(repo-wide) · high confidence
Introduce LoggerJSON module with runtime log level configuration
The library now includes a \LoggerJSON\ module that provides a \configure\_log\_level!/1\ function, allowing users to change the Logger log level at runtime (e.g., via the \LOG\_LEVEL\ environment variable). This complements the existing JSON formatters (Basic, GoogleCloud, Datadog, Elastic) by enabling dynamic log verbosity control without requiring a restart.
lib · high confidence
New Ecto and Plug telemetry integrations with structured JSON logging
This release introduces dedicated modules for structured logging of Ecto database queries and Plug web requests via telemetry. LoggerJSON.Ecto attaches a handler to log query metrics (execution, queue, decode, and total latency) in JSON format, while LoggerJSON.Plug attaches a handler to log HTTP request details (method, path, status, and duration) in JSON format. Both modules support dynamic log levels and are guarded to only load when their respective dependencies (Ecto or Plug) and :telemetry are present, ensuring the library does not crash if these dependencies are missing. Additionally, a new LoggerJSON.Redactor behavior and a built-in RedactKeys implementation allow users to redact sensitive fields from log metadata.
_lib/logger\json · high confidence
Removals
Removed pre-commit hook installation scripts
The project no longer provides scripts to automatically install or manage pre-commit hooks. The \bin/install-git-hooks.sh\ script, which previously created a symbolic link to the hook, and the \bin/hooks/pre-commit.sh\ script itself, which ran tests and linting tools (mix test, coveralls, credo, dogma), have been deleted. Users can no longer use these provided scripts to set up local pre-commit checks.
bin · high confidence
Behavioural changes
Rewrite logger backends to a new formatter architecture
The library has replaced its previous logger backend implementation with a new formatter-based architecture, introducing a \Formatter\ behaviour and dedicated formatter modules for Basic, Datadog, Elastic Common Schema (ECS), and Google Cloud. This change shifts log processing to Erlang's \:logger\ standard formatters, allowing configuration via a \new/1\ function and supporting options like \:encoder\_opts\, \:redactors\, and specific metadata selectors. The new formatters provide structured JSON output tailored to each destination, including improved error reporting for Datadog and Google Cloud, ECS-compliant fields for Elastic, and support for special metadata keys like \:module\ and \:function\ in the Basic formatter.
_lib/logger\json/formatters · high confidence
Rewrite logger backends to formatters
The library has refactored its internal architecture by replacing the previous logger backend implementation with dedicated formatter modules. This change introduces new components in the \lib/logger\_json/formatter\ directory, including \LoggerJSON.Formatter.Code\ for MFA string formatting, \LoggerJSON.Formatter.DateTime\ for RFC3339 UTC time generation, \LoggerJSON.Formatter.Message\ for handling various log message formats (including Elixir 1.19 compatibility), \LoggerJSON.Formatter.Metadata\ for managing metadata selection and exclusion, \LoggerJSON.Formatter.Plug\ for extracting remote IPs from HTTP connections, and \LoggerJSON.Formatter.RedactorEncoder\ for safely encoding and redacting log data. This restructuring aligns the library with Elixir 1.18+ and Erlang 28 requirements while improving performance and maintainability.
_lib/logger\json/formatter · high confidence
Support for Elixir 1.18+ JSON encoder and modernized configuration
The application now supports Elixir 1.18+ by dynamically selecting the \JSON\ module as the encoder for \logger\_json\ when running on that version or later, falling back to \Jason\ for older versions. Additionally, the configuration structure has been modernized to use the \import Config\ syntax, removing legacy \Mix.Config\ usage and cleaning up obsolete linter configurations (Credo, Dogma) to streamline the setup.
config · high confidence
Test coverage
Added JSON logging performance benchmark; Added comprehensive test coverage for JSON log formatters; Added test coverage for Ecto, Plug, and Formatter modules; Added test support utilities for JSON logging and GenServer simulation; Added tests for log level configuration and updated test formatters; Added unit tests for LoggerJSON formatter components.
Dependencies
Major dependency overhaul and Elixir 1.16+ support
The project has been upgraded to require Elixir 1.15.1 or 1.16+, dropping support for older versions. The dependency list has been significantly restructured: legacy tools like Distillery, Confex, Benchfella, and Dogma have been removed, while modern alternatives such as Benchee, StreamData, Castore, and Dialyxir have been added. Core optional dependencies have been updated to align with current ecosystem standards, including Jason (replacing Poison), Plug 1.15+, Ecto 3.11+, Telemetry 1.0, and Decimal. The lockfile reflects these changes with substantial version bumps across the board.
(dependencies) · high confidence
Written by watchdog.canine.dev from the codebase's own history, inside the signed delivery this page is composed from.
How this codebase got here
Baseline
- First survey — no prior run to compare against. CAI 66.
Lenses
- Code Health 99
- Architecture 96
- Maturity 54
- Readiness 57
- Security 95
Changes since last survey
- 300 commits — 262 feature/other, 38 fixes
By area
- (root) — 140 commits
- lib/logger_json — 116 commits
- test/logger_json — 13 commits
- lib/logger_json.ex — 10 commits
- test/unit — 10 commits
- .github/workflows — 5 commits
- (repo) — 2 commits
- bench/logger_json_overhead.exs — 1 commit
- config/config.exs — 1 commit
- test/formatters — 1 commit
- test/support — 1 commit
Notable commits
- fix: Bump excoveralls dep to fix coverage test (#94)
- fix: Fix Erlang version on CI
- fix: Fix GCP examples
- fix: Fix JSON examples in Elastic formatter
- fix: Fix a bug in datadog process match formatting
- fix: Fix badges
- fix: Fix broken SourceLevel image and link (#69)
- fix: Fix compatibility with Erlang 28 / Elixir 1.19
- fix: Fix copy & paste bug in the docs (#121)
- fix: Fix coverage
- fix: Fix dialyzer errors
- fix: Fix docs after we changed log to message for GCL
- fix: Fix docs for internal test struct
- fix: Fix docs for setting log level on LoggerJSON.Plug (#80)
- fix: Fix docs on metadata
- fix: Fix flaky test
- fix: Fix flaky tests
- fix: Fix inconsistency with formatter_opts type
- fix: Fix incorrect field name in module document (#41)
- fix: Fix incorrect field name in module document (#45)
- …and 280 more
Written by watchdog.canine.dev from the codebase's own history, inside the signed delivery this page is composed from.
Survey your own repository
Nebo15/logger_json was measured the same way every project in this corpus was: the same rubric, at a pinned commit, with the result published in full. Point a surveyor at a repository you know and see whether you agree with it.
About this page
- The score is its most recent published measurement, taken on 18 September 2026 at a pinned commit. It is not a live figure and does not change until the project is measured again.
- Measured at commit a045c49034cfcd6580465c96000cc41b85af92b1 — the exact code this score is about.
- Scored under rubric-2026.09.15 — the same rubric and the same method as every other entry in this index.
- Measured by watchdog.canine.dev using codehealth-analyzer preprod-5d04157a340d.