librato / statsd-librato-backend

A StatsD backend that sends metrics to Librato Metrics
MIT License
76 stars 34 forks source link

Leverage the new backend logger to log all messages if set. #34

Closed mheffner closed 10 years ago

mheffner commented 10 years ago

This way the log level can be controlled from the top-level and not require setting 'debug:true' to get error messages.

/cc @till

mheffner commented 10 years ago

Should implement #17.

till commented 10 years ago

I don't want to be picky. But I'm not entirely sure I follow this. :D

What do you gain from logAll vs debug?

mheffner commented 10 years ago

@till The idea is that (from #17) you should not have to enable a debug option to see log messages that report errors communicating with Librato. Instead, if the new logger is enabled we always log errors and use the appropriate log type, allowing the user to filter by log level if they want.

till commented 10 years ago

@mheffner I got it now. Makes a lot of sense.

I still think that more verbose output could be enabled via debug. Like other backends do — but maybe that's a personal preference.

What I am not a 100% sure about is how debug, info, warning etc. work with the different logging backends — util and node-syslog. Haven't looked into details.

mheffner commented 10 years ago

@till The logging support in statsd when we originally built out the backend API was fairly limited. I think a lot of the backends copied the if debug {log} model. Now that statsd has better built-in logging, this seems to be the next iteration of logging in the backends.