Skip to content

Don't log "served" messages - #279

Merged
erikdubbelboer merged 2 commits into
mainfrom
NoLogServedMiddleware
Oct 8, 2025
Merged

erikdubbelboer merged 2 commits into
mainfrom
NoLogServedMiddleware

Conversation

@erikdubbelboer

Copy link
Copy Markdown
Member

These messages aren't very useful and are just costly in Google Cloud Logging.

These messages aren't very useful and are just costly in Google Cloud
Logging.

@koenbollen koenbollen left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe we add an option to logging.Middleware instead? To completely disable the feature (and the middleware only adds the logger to the context).

@erikdubbelboer

Copy link
Copy Markdown
Member Author

@koenbollen it's your logging package. Adding an option to logging.Middleware would break compatibility. I think that's why you added this logging.IgnoreRequest().

@koenbollen

Copy link
Copy Markdown
Collaborator

We could do:

func Middleware(next http.Handler, logger Logger, opts... MiddlewareOption)

I'm also very ok with making a breaking change on this package. :P

@erikdubbelboer erikdubbelboer mentioned this pull request Oct 8, 2025
@erikdubbelboer
erikdubbelboer merged commit 03c0647 into main Oct 8, 2025
8 checks passed
@erikdubbelboer
erikdubbelboer deleted the NoLogServedMiddleware branch October 8, 2025 02:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants