Can anybody provide some links to how to set up correctly Lograge, logstash-logger with a Rails API app ? I followed their READMEs but still nothing sent to Kibana :(.
Here is how these gems are declared in Gemfile:
group :development do
gem ‘lograge’, ‘~> 0.10.0’ gem ‘logstash-event’, ‘~> 1.2’ gem ‘logstash-logger’, ‘~> 0.26.1’ end
``
I added the following lines in config/environments/development.rb:
config.lograge.enabled = true config.lograge.base_controller_class = ‘ActionController::API’ config.lograge.formatter = Lograge::Formatters::Logstash.new #config.lograge.logger = LogStashLogger.new(uri: ENV[‘logstash_uri’], verify_hostname: false) config.lograge.logger = LogStashLogger.new(host: ENV[‘logstash_host’], port: ENV[‘logstash_port’], verify_hostname: false) config.lograge.custom_options = lambda do |event| { name: “decastore-development” } end
``
As you see, I tried 2 different ways to initialize LogStashLogger, but still without success.
What’s wrong with that ?
I’m using Rails 5.2.0 (API only), ruby 2.5.0.
Thank you