Skip to content
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

Refine SDK's debug logging levels #216

Closed
jasdel opened this issue Sep 18, 2018 · 3 comments
Closed

Refine SDK's debug logging levels #216

jasdel opened this issue Sep 18, 2018 · 3 comments
Labels
feature-request A feature should be added or improved.

Comments

@jasdel
Copy link
Contributor

jasdel commented Sep 18, 2018

The SDK's logging levels are not the easiest to understand, and the default level of LogDebug includes a lot of information for each request/response (full header info). Any additional log level under debug will force the request/response header info to also be printed. We should reevaluate the LogLevels and their association and behavior.

Possible solution:

  • LogDebug: log message states a request has been started and when it completes.
    • Includes retry count, and time to complete.
    • If request fails, error message is logged.
  • LogDebugRetries: Logs the individual request retry attempts with per request retry error messages.

Should LogDebug payloads be per protocol, or for generic concept, e.g HTTPBody vs Body generally? V1 does payload logging per protocol/transport.

@jasdel jasdel added the feature-request A feature should be added or improved. label Sep 18, 2018
@elv-gilles
Copy link

I'm facing the situation where I'd like to log LogDebugWithRequestRetries and LogDebugWithRequestErrors (and occasinally LogDebugWithSigning) but not the usual LogDebug.

  1. As a user of the sdk, I would suggest to make aws.LogLevel an interface such that I could use my own implementation for functions Matches and AtLeast.

  2. Even with the current 'minimalistic' Logger interface the problem is that the sdk always calls it with a single string parameter instead of passing parameters and letting the default logger make the formatting (see example below).

// A Logger is a minimalistic interface for the SDK to log messages to. Should
// be used to provide custom logging writers for the SDK to use.
type Logger interface {
	Log(...interface{})
}

call example from:

func debugLogReqError(r *Request, stage string, retryStr string, err error) {
	if !r.Config.LogLevel.Matches(LogDebugWithRequestErrors) {
		return
	}

	r.Config.Logger.Log(fmt.Sprintf("DEBUG: %s %s/%s failed, %s, error %v",
		stage, r.Metadata.ServiceName, r.Operation.Name, retryStr, err))
}

@jasdel
Copy link
Contributor Author

jasdel commented Nov 11, 2020

This feature was implemented in #872

@jasdel jasdel closed this as completed Nov 11, 2020
@github-actions
Copy link

⚠️COMMENT VISIBILITY WARNING⚠️

Comments on closed issues are hard for our team to see.
If you need more assistance, please either tag a team member or open a new issue that references this one.
If you wish to keep having a conversation with other community members under this issue feel free to do so.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature-request A feature should be added or improved.
Projects
None yet
Development

No branches or pull requests

2 participants