nri icon indicating copy to clipboard operation
nri copied to clipboard

Launched plugins Stdout/Stderr are dropped

Open champtar opened this issue 1 year ago • 5 comments
trafficstars

https://github.com/containerd/nri/blob/6f5a4d2f231d1032682d2809f95a1815a08f8532/pkg/adaptation/plugin.go#L119 cmd.Stdout/Stderr are nil, so everything goes to /dev/null

champtar avatar Jan 25 '24 22:01 champtar

https://github.com/containerd/nri/blob/6f5a4d2f231d1032682d2809f95a1815a08f8532/pkg/adaptation/plugin.go#L119

cmd.Stdout/Stderr are nil, so everything goes to /dev/null

This was a conscious choice to avoid, for instance, proxying log messages through the runtime. The idea was that the plugins will set up and take care of their own logging using syslog(3).

We can update the stub so that it automatically sets up logging via syslog, when the plugin is launched by the runtime.

klihub avatar Feb 29 '24 17:02 klihub

The big limitation of using syslog is that panic text is not logged, or at least need some more work (in 1.23 we will have SetCrashOutput)

champtar avatar Feb 29 '24 20:02 champtar

Or you mean redirecting stdout / stderr to syslog in plugin.go and not in each plugins ?

champtar avatar Feb 29 '24 20:02 champtar

Or you mean redirecting stdout / stderr to syslog in plugin.go and not in each plugins ?

No, I mean in the pkg/stub, which is then on the plugin side...

klihub avatar Mar 01 '24 08:03 klihub