gelf-crystal

GELF UDP logger

gelf

A GELF compatible logger http://docs.graylog.org/en/latest/pages/gelf.html

Installation

Add this to your application's shard.yml:

dependencies:
  gelf:
    github: benoist/gelf-crystal

Usage

require "gelf"

logger ||= GELF::Logger.new("localhost", port, "WAN").configure do |config|
  config.facility = "gelf-cr"
  config.host     = "localhost"
  config.level    = Logger::DEBUG
end

logger.debug("some debug message")
logger.info("some info message")

logger.debug({ "short_message" => "some short message", "_extra_var" => "some var"}) # also set the short message

Contributing

  1. Fork it ( https://github.com/[your-github-name]/gelf/fork )
  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 a new Pull Request
Repository

gelf-crystal

Owner
Statistic
  • 5
  • 2
  • 1
  • 0
  • 0
  • over 4 years ago
  • February 25, 2016
License

MIT License

Links
Synced at

Thu, 07 Nov 2024 01:28:12 GMT

Languages