containerd / nri

Node Resource Interface
Apache License 2.0
257 stars 65 forks source link

Launched plugins Stdout/Stderr are dropped #65

Open champtar opened 10 months ago

champtar commented 10 months ago

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

klihub commented 8 months ago

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.

champtar commented 8 months ago

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 commented 8 months ago

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

klihub commented 8 months ago

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...