semantic_logger
Semantic Logger is a structured, asynchronous logging framework for Ruby and Rails that preserves searchable data (hashes, exceptions, metrics) instead of flattening logs to text. It uses a background thread to queue and write logs without blocking the application, supporting dozens of destinations from Elasticsearch to Splunk to Syslog.
Key facts
Objective fields from the source. Values we can't verify are shown as “Unknown” rather than guessed.
| Field | Value |
|---|---|
| Repository | reidmorrison/semantic_logger |
| Owner | reidmorrison |
| Primary language | Ruby |
| License | Apache-2.0 — OSI-approved |
| Stars | 955 |
| Forks | 138 |
| Open issues | 0 |
| Latest release | Unknown |
| Last updated | 2026-07-08 |
| Source | https://github.com/reidmorrison/semantic_logger |
What semantic_logger is
A high-performance Ruby gem providing asynchronous structured logging with in-memory queueing, multiple appender outputs (file, ElasticSearch, Graylog, Sentry, OpenTelemetry, etc.), and optional dependencies for specialized integrations. Logs are preserved as structured data through the entire pipeline, enabling downstream searching and analytics.
Get the semantic_logger source
Clone the repository and explore it locally.
git clone https://github.com/reidmorrison/semantic_logger.gitcd semantic_logger# follow the project's README for install & configurationNeed it deployed, integrated, or customized instead? DEV.co ships production installs.
Best use cases
Implementation considerations
- Asynchronous queueing trades latency for throughput; in resource-constrained environments (e.g., Lambda, containers with tight memory), monitor queue depth and appender thread behavior.
- Optional dependencies (Elasticsearch, Splunk, MongoDB, Sentry gems) must be manually included; ensure your Gemfile declares them only if those appenders are used.
- When running Rails, use rails_semantic_logger gem instead of semantic_logger directly to avoid conflicts with Rails' logger initialization.
- Background thread may not flush logs on abrupt process termination (kill -9); configure graceful shutdown hooks if durability on exit is critical.
- Performance scales well for thousands of logs/sec; test queue backlog behavior under peak load and monitor appender thread for blocking I/O or network latency.
When to avoid it — and what to weigh
- Non-Ruby/Rails Ecosystems — Semantic Logger is Ruby-specific. If your stack is Python, Go, Node.js, or .NET, choose language-native logging libraries (e.g., Loguru, Zap, Winston, Serilog).
- Minimal Logging Requirements — If you only need basic text logging to stdout or a single file with no structured data or integrations, Ruby's built-in Logger or Rails' default logger will suffice; Semantic Logger adds overhead and complexity.
- Strict Synchronous Logging Guarantees — Semantic Logger's asynchronous queueing means log delivery is not guaranteed on immediate shutdown or OOM. If you require synchronous, blocking writes with absolute durability guarantees, configure appenders explicitly or use a blocking mode.
- Enterprise License or Support Requirements — Semantic Logger is Apache 2.0 licensed with no commercial support entity. If your organization requires vendor-backed SLAs, professional indemnity, or proprietary terms, evaluate commercial alternatives.
License & commercial use
Apache License 2.0 (Apache-2.0). This is a permissive OSI-approved license permitting commercial use, modification, and distribution with attribution and liability/warranty disclaimers.
Apache 2.0 explicitly permits commercial use without royalties or licensing fees. However, no vendor provides commercial support, SLAs, or indemnification. Organizations requiring enterprise support, liability insurance, or vendor indemnity should clarify expectations with legal counsel and plan for community-only support.
DEV.co evaluation signals
Editorial assessment — not user reviews. Directional, with an explicit confidence level.
| Signal | Assessment |
|---|---|
| Maintenance | Active |
| Documentation | Strong |
| License clarity | Clear |
| Deployment complexity | Low |
| DEV.co fit | Strong |
| Assessment confidence | High |
Semantic Logger itself provides no special hardening. Risks: (1) In-memory queue may expose sensitive payloads in memory dumps; sanitize or redact PII before logging. (2) Async delivery on shutdown may lose logs in crash scenarios; validate critical audit logs are persisted. (3) Appender credentials (e.g., API keys for Sentry, BugSnag) must be stored securely via environment variables or secrets management, not hardcoded. (4) Ensure appender destinations (HTTP, TCP, Elasticsearch) use TLS and validate certificates. No known CVEs listed; auditing appender dependency updates is recommended.
Alternatives to consider
Ruby's Built-in Logger or Rails Default Logger
If you need simple text-only logging without structured data, integration overhead, or background threading. Suitable for small apps or development; lacks performance and observability features.
Lograge (Rails-specific)
Lightweight Rails request logging with JSON output. Good for single-appender, request-scoped logging; lacks semantic structure for application-level events, exception context, or multiple simultaneous destinations.
Loki (Grafana) + Promtail
Cloud-native log aggregation for multi-language stacks. Requires separate infrastructure; suited for Kubernetes and observability platforms. Less suitable for structured payloads within Ruby; requires external parsing.
Build on semantic_logger with DEV.co software developers
Evaluate Semantic Logger in a staging environment. Test appender integrations, monitor queue performance under load, and compare latency gains vs. your current logger. Contact us to discuss multi-destination observability strategies.
Talk to DEV.coRelated open-source tools
Surfaced by semantic similarity across the DEV.co open-source index.
Related on DEV.co
Explore the category and the services that help you build with it.
semantic_logger FAQ
Will Semantic Logger slow down my Rails app?
Do I need to install all optional dependencies?
How do I integrate Semantic Logger with Rails?
What happens to logs if the app crashes or shuts down abruptly?
Custom software development services
DEV.co helps companies turn open-source tools like semantic_logger into production software. Our software development services cover the full lifecycle — architecture, web development, integration, and maintenance — delivered by software developers and web developers who ship. Engage our software development agency to implement or customize it for your open-source observability stack.
Ready to upgrade your Rails logging?
Evaluate Semantic Logger in a staging environment. Test appender integrations, monitor queue performance under load, and compare latency gains vs. your current logger. Contact us to discuss multi-destination observability strategies.