add the HTTP verb to the log to differentiate which endpoint is actually used
use structured logging, so it will be easier to process the log afterward. For instance, structured logging allows data to be a key value inside a json
move the span from the top-level function to the inner wrapper, so we don't get to see the parameters. Parameters can contain sensitive information (https://github.com/jmgilman/vaultrs/pull/85) and tends to bloat the logs. Users can still log the parameter if they want by adding a trace themself.
remove some info traces that were redundant or did not contains useful information
Here there is an example to the new log, which can be useful to compare with the one in https://github.com/jmgilman/vaultrs/pull/85 . Here, RUST_LOG="info,rustify=off" is used, as it won't likely to be fixed upstream.
Unhappy path:
2024-03-27T08:06:02.413716Z INFO request{method=GET path=/sys/health}: vaultrs::api: start request
2024-03-27T08:06:02.422478Z ERROR request{method=GET path=/sys/health}: vaultrs::api: error=An error occurred with the request
Happy path:
2024-03-27T08:06:00.283379Z INFO request{method=POST path=/sys/init}: vaultrs::api: start request
Attempt to address some of the concerns raised in https://github.com/jmgilman/vaultrs/issues/86
Here there is an example to the new log, which can be useful to compare with the one in https://github.com/jmgilman/vaultrs/pull/85 . Here,
RUST_LOG="info,rustify=off"
is used, as it won't likely to be fixed upstream.Unhappy path:
Happy path: