fluet-logger implementation for Crystal inspired by fluent-logger-ruby
Add this to your application's shard.yml
:
dependencies:
fluent-logger:
github: takaishi/fluent-logger-crystal
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"}
require "fluent-logger"
Fluent::Logger::FluentLogger.open(nil, host: "localhost", port: 24224)
Fluent::Logger.post("myapp.access", {agent: "foo"})
# output: myapp.access {"agent":"foo"}
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
TODO: Write development instructions here
- Fork it ( https://github.com/takaishi/fluent-logger-crystal/fork )
- Create your feature branch (git checkout -b my-new-feature)
- Commit your changes (git commit -am 'Add some feature')
- Push to the branch (git push origin my-new-feature)
- Create a new Pull Request
- takaishi Ryo Takaishi - creator, maintainer