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

[FEATURE REQUEST] Logger interface support context.Context #1016

Open
poetlife opened this issue Feb 10, 2025 · 0 comments
Open

[FEATURE REQUEST] Logger interface support context.Context #1016

poetlife opened this issue Feb 10, 2025 · 0 comments
Assignees
Labels
enhancement New feature or request

Comments

@poetlife
Copy link

Is your feature request related to a problem? Please describe.

Current log.Base interface doesn't support explicitly pass ctx param which is important for log observability such as OpenTelemetry.

Describe the solution you'd like

Provide another interface which accepts a ctx context.Context parameter, such as:

type LoggerWithContext interface {
	// Debug logs a message at Debug level.
	Debug(ctx context.Context, args ...interface{})

	// ...
}

Describe alternatives you've considered

No alternatives.

Additional context

In production environments, we need something like trace_id to relate many logs. So, it's important to log with context.

@poetlife poetlife added the enhancement New feature or request label Feb 10, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants