Channel: Logging output
Opened this issue · 2 comments
Currently the channels are not able to log anything, which makes debugging unnecessarily difficult1.
Due to the strict request-response API logic, a new "Log" method should be introduced, which just got consumed from the RPC,
wrapping the message and logging it to icinga-notification's logger. On the channel's side, a specially configured zap logger is needed.
Footnotes
-
I just stumbled about Icinga/icinga-notifications-web#154 again, even as I filled this issue back then.. ↩
Currently the channels are not able to log anything
Their stderr should be forwarded to the daemon logs:
icinga-notifications/internal/channel/plugin.go
Lines 70 to 76 in cef9ec2
icinga-notifications/internal/channel/plugin.go
Lines 157 to 166 in cef9ec2
While not perfect (in particular, this doesn't allow to convey the severity of a message at the moment), this should be enough for debugging purposes.
Thanks, I wasn't aware of this as I mostly looked into pkg/plugin
and only briefly into internal/channel
. Then I would suggest documenting the stderr behavior somewhere in pkg/plugin
and furthermore initialize a custom zap logger in RunPlugin
to allow writing same logging code as everywhere else.