Unconditional logging, or logging filtered by tag(s)
Describe the feature
We need to be able to write messages to log files, no matter which value global logging level is set. Or, as a better option, to be able to set a log filter, to allow for only messages matching specific tag(s) to be logged.
Use Case
Here is the issue.
Logging level is set globally, so if I want to log a couple of warn messages from my code, I find log files polluted to the limit with tons (literally) of messages from other subsystems, like some HTTP threads logging "warnings" several times every millisecond:
[WARN] 2025-10-14 13:41:58.209 http-connection [103460] id=01019428: Outgoing frames task sent no data, will try again next tick.
[WARN] 2025-10-14 13:41:58.209 http-connection [103460] id=01019428: Outgoing frames task sent no data, will try again next tick.
[WARN] 2025-10-14 13:41:58.209 http-connection [103460] id=01019428: Outgoing frames task sent no data, will try again next tick.
[WARN] 2025-10-14 13:41:58.209 http-connection [103460] id=01019428: Outgoing frames task sent no data, will try again next tick.
...
[WARN] 2025-10-14 13:41:58.209 http-connection [103460] id=01019428: Outgoing frames task sent no data, will try again next tick.
[WARN] 2025-10-14 13:41:58.210 http-connection [103460] id=01019428: Outgoing frames task sent no data, will try again next tick.
[WARN] 2025-10-14 13:41:58.210 http-connection [103460] id=01019428: Outgoing frames task sent no data, will try again next tick.
[WARN] 2025-10-14 13:41:58.210 http-connection [103460] id=01019428: Outgoing frames task sent no data, will try again next tick.
[WARN] 2025-10-14 13:41:58.210 http-connection [103460] id=01019428: Outgoing frames task sent no data, will try again next tick.
[WARN] 2025-10-14 13:41:58.210 http-connection [103460] id=01019428: Outgoing frames task sent no data, will try again next tick.
[WARN] 2025-10-14 13:41:58.210 http-connection [103460] id=01019428: Outgoing frames task sent no data, will try again next tick.
Proposed Solution
- Add unconditional logging macro
- Add logging filtering, a list of tags allowed (or not allowed) to log, or, a better solution, an optional bool function, accepting a tag, passed to logging macro.
Other Information
No response
Acknowledgements
- [ ] I may be able to implement this feature request
- [ ] This feature might incur a breaking change
The current SDK logging behavior is by design, adding selective or dynamic log filtering will introduce additional runtime complexity. Are there specific logs you’re trying to view?
Thank you for your answer. Not specific, I just can't find my messages in this mess. Imagine logging a couple of warnings in a minute worth log file, while http-connection spits 10K (useless) warnings per second.
To do that, I'd need to be able to lo log my messages while log level is set rather high, error or fatal, or to block unnecessary messages by tags, while setting lower log level (debug or trace).