hashicorp / go-plugin

Golang plugin system over RPC.
Mozilla Public License 2.0
5.25k stars 450 forks source link

Logging for a gRPC plugin in Java not working #279

Closed hariso closed 1 year ago

hariso commented 1 year ago

Hello!

Firstly, thank you for this extremely useful project!

I'm having an issue with logging in a gRPC plugin implemented in Java. To my understanding, and based on this comment, if the gRPC plugin writes to stderr, it should be logged in the host process.

However, I could not see that happen. Instead, in the client logs, I could see this:

2023-09-12T13:58:37+00:00 DBG received EOF, stopping recv loop err="rpc error: code = Unimplemented desc = Method not found: plugin.GRPCStdio/StreamStdio" plugin_name=stdio

So what I did is to implement a gRPC service: https://github.com/ConduitIO/conduit-kafka-connect-wrapper/blob/fedaae52f9d465314e98c0a3b3049ce7fec1f55c/src/main/java/io/conduit/GrpcStdio.java, which worked.

My question is: is this supposed to be working like this? We planned some logging improvements for that project and simply sending everything to stderr would help a lot.

hariso commented 1 year ago

As I was looking into this one more I noticed that what's being written to stderr is indeed appearing in the host. The problem was the log level in the host.