0.0
No release in over 3 years
Trifle::Logs is a way too simple log store with quick search on top of it
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
 Dependencies

Development

~> 2.1
>= 0
~> 3.2
= 1.0.0
 Project Readme

Trifle::Logs

Gem Version Ruby

File-based log storage with ripgrep-powered search for Ruby. Dump structured logs to disk, then search them with fast regex queries and paginate with head/tail. No Elasticsearch. No external services.

Part of the Trifle ecosystem.

Quick Start

gem 'trifle-logs'

1. Configure

require 'trifle/logs'

Trifle::Logs.configure do |config|
  config.driver = Trifle::Logs::Driver::File.new(path: './logs')
  config.formatter = Trifle::Logs::Formatter::Json.new
end

2. Dump logs

Trifle::Logs.dump('orders', 'Order #1234 processed successfully')
Trifle::Logs.dump('orders', 'Payment confirmed for $49.90')

3. Search

result = Trifle::Logs.searcher('orders', pattern: 'Payment').perform
result.data
#=> [{ "type" => "match", "data" => { "lines" => { "text" => "Payment confirmed for $49.90\n" }, ... } }]

Features

  • File-based storage. Simple, reliable, no external dependencies.
  • Fast search. Uses ripgrep for high-performance regex queries.
  • Flexible formatting. JSON, text, and timestamp formatters.
  • Pagination. Head/tail navigation through log files.
  • Structured logging. Scope and metadata support.

Formatters

  • JSON. Structured output with timestamps and scope.
  • Text. Plain text for human readability.
  • Timestamp. Automatic timestamping on all entries.

Documentation

Full guides and API reference at docs.trifle.io/trifle-logs

Trifle Ecosystem

Component What it does
Trifle App Dashboards, alerts, scheduled reports, AI-powered chat.
Trifle::Stats Time-series metrics for Ruby (Postgres, Redis, MongoDB, MySQL, SQLite).
Trifle CLI Terminal access to metrics. MCP server mode for AI agents.
Trifle::Traces Structured execution tracing for background jobs.
Trifle::Docs Map a folder of Markdown files to documentation URLs.

Contributing

Bug reports and pull requests are welcome on GitHub at https://github.com/trifle-io/trifle-logs.

License

The gem is available as open source under the terms of the MIT License.