Ruby MIT

logstash-logger

Ruby logger that writes logstash events

D

dwbutler

Dernière activité 4 mars 2026
dwbutler/logstash-logger

462

étoiles

116

forks

14

issues ouvertes

jsonlogginglogging-librarylogstashredisrubytcpudp

Ce README est souvent en anglais.

LogStashLogger

Build Status Code Climate codecov.io Gem Version

LogStashLogger extends Ruby's Logger class to log directly to Logstash. It supports writing to various outputs in logstash JSON format. This is an improvement over writing to a file or syslog since Logstash can receive the structured data directly.

Features

  • Can write directly to a logstash listener over a UDP or TCP/SSL connection.
  • Can write to a file, Redis, Kafka, Kinesis, Firehose, a unix socket, syslog, stdout, or stderr.
  • Logger can take a string message, a hash, a LogStash::Event, an object, or a JSON string as input.
  • Events are automatically populated with message, timestamp, host, and severity.
  • Writes in logstash JSON format, but supports other formats as well.
  • Can write to multiple outputs.
  • Log messages are buffered and automatically re-sent if there is a connection problem.
  • Easily integrates with Rails via configuration.

Installation

Add this line to your application's Gemfile:

gem 'logstash-logger'

And then execute:

$ bundle

Or install it yourself as:

$ gem install logstash-logger

Ruby Compatibility

Verified to work with:

  • MRI Ruby 3.2, 3.3, 3.4, 4.0
  • JRuby 10.x

Ruby versions < 3.2 are EOL'ed and no longer supported.

Documentation

Contributing

  1. Fork it
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create new Pull Request

Projets similaires

Logstash - transport and process your logs, events, or other data

Javaetl-frameworkjavajruby
Eelastic
15 k étoiles3,5 k

A structured logger for Fluentd (Ruby)

Rubyfluentdfluentd-loggerruby
Ffluent
256 étoiles77

Fluentd: Unified Logging Layer (project under CNCF)

Rubycncfdata-collectorfluentd
Ffluent
13,6 k étoiles1,4 k