A Ruby structured logging library that handles messages, custom data, and exceptions, outputting JSON or human-readable logs.
Ougai is a structured logging library for Ruby that extends the standard Logger class. It enables developers to log messages, structured data, and exceptions with ease, outputting logs in JSON format compatible with Bunyan and pino or in a human-readable format for console debugging. It solves the problem of inconsistent and hard-to-parse log formats in Ruby applications.
Ruby developers building applications that require structured, machine-readable logs for monitoring, debugging, or integration with log aggregation systems like Fluentd, Logentries, or Loggly.
Developers choose Ougai for its seamless compatibility with Ruby's existing Logger, its support for child loggers and field merging, and its interoperability with popular Node.js logging tools, making it a versatile choice for modern Ruby logging needs.
A Ruby structured logging is capable of handling a message, custom data or an exception easily and generates JSON or human readable logs.
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
Adds a TRACE logging level lower than DEBUG for finer-grained control, as shown in the usage examples where level can be set to :trace.
Supports logging messages, structured data, exceptions, or any combination with intuitive syntax, demonstrated through multiple code snippets in the README.
Enables creation of nested loggers with inherited and merged fields, including recursive hash merging, ideal for contextual logging in complex services.
Allows output to multiple targets simultaneously via Ougai::Logger.broadcast, similar to ActiveSupport::Logger.broadcast, with clear examples for STDOUT and file logging.
The human-readable formatter requires the Amazing Print gem, adding an external dependency that might complicate deployment or increase bundle size.
Only provides JSON and human-readable formatters out of the box; custom formats require additional development or reliance on community extensions.
Integrating with frameworks like Rails or Sidekiq requires following external wiki guides, which can be non-trivial and add to initial setup time.