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

Custom fields in log statement? #13

Closed
maros7 opened this issue Sep 11, 2019 · 2 comments
Closed

Custom fields in log statement? #13

maros7 opened this issue Sep 11, 2019 · 2 comments

Comments

@maros7
Copy link

maros7 commented Sep 11, 2019

Hi, I'm wondering if you'd consider a PR for adding functionality to make it possible to add custom fields to the log statement? E.g. by having something like:

func WithCustomFields(logger *zap.Logger,
	timeFormat string,
	utc bool,
	customFields ...func(c *gin.Context) zap.Field,
) gin.HandlerFunc {

...

Our use-case is that we need to log the return headers.

@thinkgos
Copy link

@maros7 this package https://github.com/things-go/gzap may meet you need.

@appleboy
Copy link
Member

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 a pull request may close this issue.

3 participants