# Trifle::Logs ## Content # Trifle::Logs [![Gem Version](https://badge.fury.io/rb/trifle-logs.svg)](https://rubygems.org/gems/trifle-logs) [![Ruby](https://github.com/trifle-io/trifle-logs/workflows/Ruby/badge.svg?branch=main)](https://github.com/trifle-io/trifle-logs) `Trifle::Logs` is a minimal file-backed logger with a fast searcher. ## What it does - Writes logs to disk via drivers (File). - Supports text and JSON content formatters. - Searches logs locally with paging support. ## Quick example ```ruby Trifle::Logs.configure do |config| config.driver = Trifle::Logs::Driver::File.new(path: '/var/logs/trifle', suffix: '%Y/%m/%d') config.timestamp_formatter = Trifle::Logs::Formatter::Timestamp.new config.content_formatter = Trifle::Logs::Formatter::Content::Json.new end Trifle::Logs.dump('billing', { event: 'invoice_charged', id: 42 }, scope: { request_id: 'req-1' }) result = Trifle::Logs.searcher('billing', pattern: 'invoice').perform lines = result.data.map { |entry| entry.dig('data', 'lines', 'text') } ``` ## What to expect - Log files written under the driver path. - `searcher.perform` returns a Result with `data` + `meta`. - No external log service required. ## Next steps - [Getting Started](/trifle-logs/getting_started) - [Configuration](/trifle-logs/configuration) - [Usage](/trifle-logs/usage) - [Drivers](/trifle-logs/drivers) - [Formatters](/trifle-logs/formatters) - [Guides](/trifle-logs/guides)