Skip to content
This repository has been archived by the owner on Feb 20, 2023. It is now read-only.

takaishi/fluent-logger-crystal

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

fluent-logger-crystal

Build Status

fluet-logger implementation for Crystal inspired by fluent-logger-ruby

Installation

Add this to your application's shard.yml:

dependencies:
  fluent-logger:
    github: takaishi/fluent-logger-crystal

Usage

Simple

require "fluent-logger"

log = Fluent::Logger::FluentLogger.new(nil, host: "localhost", port: 24224)
unless log.post("myapp.access", {agent: "foo"})
  p log.last_error # You can get last error object via last_error method
end

# output: myapp.access {"agent":"foo"}

Singleton

require "fluent-logger"

Fluent::Logger::FluentLogger.open(nil, host: "localhost", port: 24224)
Fluent::Logger.post("myapp.access", {agent: "foo"})

# output: myapp.access {"agent":"foo"}

Tag Prefix

require "fluent-logger"

log = Fluent::Logger::FluentLogger.new("myapp", host: "localhost", port: 24224)
log.post("access", {agent: "foo"})

# output: myapp.access {"agent":"foo"}

TODO: Write usage instructions here

Development

TODO: Write development instructions here

Contributing

  1. Fork it ( https://github.com/takaishi/fluent-logger-crystal/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

Contributors

  • takaishi Ryo Takaishi - creator, maintainer

About

Fluentd logger for Crystal.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published