diff --git a/resource3/plugins/binary/call.go b/resource3/plugins/binary/call.go index 45b2bad97..ea4ee7054 100644 --- a/resource3/plugins/binary/call.go +++ b/resource3/plugins/binary/call.go @@ -19,7 +19,7 @@ func (p Plugin) call(ctx context.Context, cmd string, req interface{}, resp inte command.Dir = p.config.ResourcePlugin.Dir logger.Infof(ctx, "call %s", command.String()) - out, err := p.execCommand(command, req) + out, err := p.execCommand(ctx, command, req) if err != nil { logger.Error(ctx, err, string(out)) return err @@ -31,11 +31,13 @@ func (p Plugin) call(ctx context.Context, cmd string, req interface{}, resp inte return json.Unmarshal(out, resp) } -func (p Plugin) execCommand(cmd *exec.Cmd, req interface{}) ([]byte, error) { +func (p Plugin) execCommand(ctx context.Context, cmd *exec.Cmd, req interface{}) ([]byte, error) { + logger := log.WithFunc("resource.binary.execCommand") b, err := json.Marshal(req) if err != nil { return nil, err } + logger.WithField("in", string(b)).Debug(ctx, "call params") cmd.Stdin = bytes.NewBuffer(b) return cmd.CombinedOutput() }