dwbutler / logstash-logger

Ruby logger that writes logstash events
MIT License
454 stars 118 forks source link

[Discussion] Add filename and line number to the default log event object #125

Open lanxx019 opened 7 years ago

lanxx019 commented 7 years ago

Any objection or suggestion on how to add the filename and line number to the default event object? There are definitely other ways you can track down the log entry in source code, but wouldn't it be simpler if we include these information automatically?

dwbutler commented 7 years ago

caller_locations looks like a good place to start.

I don't imagine this information would be useful to add to every log message by default. I can only imagine it being useful on log messages for exceptions. But in that case, you could include the backtrace.

If you really need it on every event you could look into patching that into your own customize_event block.