logstasher icon indicating copy to clipboard operation
logstasher copied to clipboard

Default message for log lines

Open hashwin opened this issue 4 years ago • 0 comments

When using filebeat, if I specify a message, it shows up in the log stream, otherwise it shows up as failed to find message

Lograge specifes a default message like this: https://github.com/roidrage/lograge/blob/master/lib/lograge/formatters/logstash.rb#L10

I am able to set it for controller methods like this:

LogStasher.add_custom_fields do |fields|
  fields[:message] = "[#{status}] #{fields[:controller]}##{fields[:action]}"
end

But when using ActiveJob and views, this is never called. Ideally, there should be some default messages here because Rails is pretty standard that way, but I should at least be able to configure it. Is there a provision where I could set this up?

hashwin avatar Sep 24 '20 13:09 hashwin