dropwizard / dropwizard Public
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
requestContent and responseContent always return "-" in request log #2045
Comments
@Wstunes The logFormat is incorrect. Correct as follows: logFormat: "%h|%t{yyyy/MM/dd HH:mm:ss}|%D|%requestContent|%responseContent" In addition, it is necessary to register environment.servlets().addFilter("teeFilter", TeeFilter.class).addMappingForUrlPatterns(null, false, "/*"); |
@t-tsutsumi |
@Wstunes There are several solutions; but perhaps extend the |
Closing this as the question appears answered. If not, please respond to re-open. Thank you @t-tsutsumi for the great insight |
I know this issue is closed but how is anyone supposed to know that they need to add a TeeFilter? Or is this fixed in newer versions of Dropwizard? |
I've made a PR to document this in #2596 |
the request log config in my config.yaml is like the following
But output of the requestContent and responseContent is always "-"
I am following the logback instruction here https://logback.qos.ch/manual/layouts.html#AccessPatternLayout
Am I missing some configuration?
Or is there some way to format the request log via code?
Thanks
The text was updated successfully, but these errors were encountered: