dwbutler / logstash-logger

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

Not everybody has logstash installed #146

Closed lackita closed 6 years ago

lackita commented 6 years ago

We've got logstash installed on a production rails environemnt and I'd really like to use it to do more structured logging. The problem is, not everybody in dev has logstash installed, and so methods like reset and additional arguments to logging methods would completely fail.

Is there a straightforward way to resolve this? I tried building a logger that responds to those situations silently and delegated only if logstash was available, but that didn't work very well.

lackita commented 6 years ago

For anybody else running into this, I ended up adding an empty reset method to the base Logger class and passing a dict into the first argument (which seems to get converted to a string if it's not a logstash logger).