vault-csi-provider icon indicating copy to clipboard operation
vault-csi-provider copied to clipboard

feat: Enable json logging format

Open stewartshea opened this issue 3 years ago • 5 comments

Specifically for GKE environments that leverage Google Cloud Operations Logging, logs generated by the provider are all classified as ERROR rather than the proper type as outlined in stdout/stderr. It would be helpful to be able to set the log output in json format such that Operations Logging can properly classify the log type.

image

stewartshea avatar Sep 01 '22 13:09 stewartshea

Thanks for raising! I'd like to add this. The equivalent Vault server log option are here for reference/consistency: https://www.vaultproject.io/docs/commands/server#log-format. Although we already diverged by using -debug instead of -log-level.

The logging library supports JSON output already, so it should be relatively straightforward if you're interested in tackling it: https://pkg.go.dev/github.com/hashicorp/go-hclog#LoggerOptions. Otherwise I'll get to this at some point.

tomhjp avatar Sep 01 '22 14:09 tomhjp

Thanks @tomhjp for the details, I'll see if I can set aside a little time to tackle and PR it.

stewartshea avatar Sep 01 '22 14:09 stewartshea

Is this request still open? It would be great if this capability is added to the csi.

krishnadas-m avatar Apr 06 '23 05:04 krishnadas-m

@tomhjp Let me know if there are any issues with the MR.

jbgcarnes avatar Dec 05 '23 19:12 jbgcarnes