-
Notifications
You must be signed in to change notification settings - Fork 3
Use slog logger and enable s3 http request logs #30
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
When the log level is not set to debug and an error occurs we still get meaningful error messages from AWS: {"time":"2026-01-30T14:27:53.504115+01:00","level":"ERROR","msg":"performing operation","command":"exists","error":"failed to check exist: operation error S3: HeadObject, https response error StatusCode: 403, RequestID: 188F853C81E454B8, HostID: dd9025bab4ad464b049177c95eb6ebf374d3b3fd1af9251148b658df7ac2e3e8, api error Forbidden: Forbidden"} |
|
Non-existing blob: The last log-line should be on INFO and not on ERROR level. The "exists" operation returned the desired result and there was no problem with executing the request. Only the client can decide if a non-existing blob is an error or not. For CAPI, ERROR logs for non-existing blobs would lead to log pollution for resource matching. |
serdarozerr
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks good, just a minor suggestion added
This log message was redundant was clients already log if a blob does
not exist, e.g. '{"time":"2026-01-30T17:17:05.405448+01:00","level":"INFO","msg":"Blob does not exist in bucket","bucket":"storage-cli","blob":"bommel3"}'
PR #22 introduced slog for logging for S3, GCS and Ali. To ensure a consistent logging format this PR adopts slog for S3.
Additionally a new http logging middleware is added for S3 which prints request logs when needed (e.g. with flag
-log-level debug). The existingmiddlewares.gohas been renamed toaccept_encoding_fix.goand moved to thes3middlewarefolder for clearer structure.S3 Debug Log Format
S3 Debug Log Format
Non-Existing Blob
Put Blob
Existing Blob
Get Blob
Delete Blob