simplemonitor icon indicating copy to clipboard operation
simplemonitor copied to clipboard

Inappropriate use of stderr

Open jayennis22 opened this issue 5 years ago • 1 comments

It strikes me as inappropriate for a health monitoring application like this to report the results of its monitors to stderr, especially since those errors and warnings often apply to different systems than the one where simplemonitor is running. The only messages I want to see from simplemonitor on stderr are messages about problems simplemonitor itself is experiencing, such as "Couldn't write to pidfile!", "Unknown alerter type %s; valid types are: %s", "Listener thread died :(".

Examples of messages I don't feel should use stderr include:

  • ERROR (simplemonitor) monitor failed: xxxxxx (Requests exception while opening URL: HTTPSConnectionPool(host='www.xxxx.com', port=443): Read timed out. (read timeout=5))
  • ERROR (simplemonitor) monitor failed: xxxxx (Destination unreachable: Host unreachable.)
  • WARNING (simplemonitor) monitor failed but within tolerance: xxxxxx

Thanks for hearing my opinion. I really appreciate your work on this!

jayennis22 avatar Aug 10 '20 17:08 jayennis22

Interesting, I'd not noticed stuff going to stdout/stderr differently, just because of the ways I'd interacted with it (i.e. both were merged). I agree, there's an argument for stderr just showing simplemonitor's runtime errors (and stdout getting monitor-related ones then?). That should be doable with suitable configuration of the Python logging library, and some small code changes to use the right logging instance at the right time. I'll give it some thought :)

Thanks for the feedback!

jamesoff avatar Aug 10 '20 18:08 jamesoff