loading...
Cover image for What are the most important features you look for in a logger?

What are the most important features you look for in a logger?

nombrekeff profile image Manolo Edge ・1 min read

I'm interested in knowing what are the most important features you look for in a logger? Should it have colored output, should it allow multiple output channels...

PD: I know it depends on the task you are approaching, but let's generalize for a bit :P

I currently maintain a Loggin' library for NodeJS and for the browser (partially), and wanted to gather some information on what features people want the most in a logger, as a way of improving the library.

Discussion

pic
Editor guide
 

The number one thing I look for is flexibility, even if just in the form of extensibility. Mostly because that's what I, as an end user, expect from the logging functionality of any application I use. As a user I shouldn't have to jump through hoops to get stuff like log rotation or logging to syslog to work, and therefore when developing software, I shouldn't need to jump through hoops to enable such functionality for my users.

The logging package that's part of Python's standard library is a good example of a logger that I feel covers this aspect very well. Filtering, formatting, and dispatch are all handled in an extremely extensible manner, and the dispatch side of things includes a bunch of useful options as part of the package itself, including logging to arbitrary Stream objects, sending log records via email or webhooks, and even offloading log processing to a different thread or process.

 

Cool, thanks for the explanation, I've always considered it very important, that it is extensible/flexible!