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

logging response body #25

Open
rrajkowski opened this issue Mar 14, 2023 · 0 comments
Open

logging response body #25

rrajkowski opened this issue Mar 14, 2023 · 0 comments

Comments

@rrajkowski
Copy link

@ziflex thanks for the reply. I was able to implement the MultiLevelWriter. I am writting to Stdout and file.
I have a new issue added the response from c.Response echo context to the lecho logger.

I've tried the following:

Echo Bodydump middleware as a separate log.
Enricher method:
Enricher: func(c echo.Context, logger zerolog.Context) zerolog.Context {
return e.Interface("response", c.Response())
},
Ideally I can update or modify the logger context with response for a single stdout/file log.
I think it would be cool to allow combining of Bodydump and Enricher somehow.
I've read through this Zerolog guild but didn't find any working solutions

Thanks

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

No branches or pull requests

1 participant