sensu-go
sensu-go copied to clipboard
Implement "facilities" and "selectors" to customize log output
Feature Suggestion
Given the number of different components that can output log messages in Sensu, it might make sense to introduce the concepts of "facility" and "selector". These concepts would be loosely modeled on the syslog protocol and the syslogd implementation.
A facility is essentially a Sensu component. A selector is essentially the combination of a component and a log level.
We already have named loggers for various components. We should be able to individually configure them so that one can tailor the log output to their needs.
This is mainly relevant for sensu-backend
and sensu-agent
.
Possible Implementation
Keep using the currently implemented Logrus named loggers, but implement a system to individually configure them, be it on the command line or the configuration file.
For example, --log-level apid.info,scheduler.error
would only output info and above messages coming from apid
and error and above messages coming from schedulerd
.
Context
I'm trying to think of ways to give users and developers a better way to get the information they need out of the logs.
I love it! And the proposal is completely backwards compatible with the current --log-level
. :star:
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
Still relevant! I love this proposal. 💪
TBD on prioritization, but we have a number of customer requests that I'm hoping we could begin to address with the right plan around a gradual implementation here. 🤞
Related: https://github.com/sensu/sensu-go/pull/4308