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

feat(option): add WithPathLevel option #72

Merged
merged 1 commit into from
Feb 2, 2024

Conversation

goodevilgenius
Copy link
Contributor

Resolves #71

The following can now be done:

r := gin.New()
r.Use(logger.SetLogger(
    logger.WithPathLevel(map[string]zerolog.Level{"/health": zerolog.DebugLevel}),
)

Any successful requests to /health would result in a debug level log, instead of the default info level.

@appleboy appleboy changed the title Feat: WithPathLevel option feat(option): add WithPathLevel option Feb 2, 2024
@appleboy appleboy added the enhancement New feature or request label Feb 2, 2024
@appleboy appleboy merged commit 62dc492 into gin-contrib:master Feb 2, 2024
@goodevilgenius goodevilgenius deleted the feat/path-level branch February 2, 2024 14:28
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

Successfully merging this pull request may close these issues.

Allow for a logging level to be set for specific routes
2 participants