Comments (6)
I think it can be helpful to make the right filtering decision if it had more context. As you mentioned, at least to know if it's a request/response and what's the origin.
As per the example you mentioned, I understand it's just an example, but just to point out that this is already possible. You could use the ResponseFilter
for cases when you want to omit logging the response body based on some conditions. That's what ResponseFilters.defaultValue() is using via BodyReplacers to avoid logging bodies with binary data.
from logbook.
Thank you for the prompt answer @kasmarian . Honestly I was not aware of that, but yes it was just an example. That said I still see value in having more context in filters so that people have more flexibility to make decisions 🙂
Would this be something that your team would consider adding?
Thank you
from logbook.
We could have a look, yes, but I can't tell you any timeline promises. If you have time and desire, please feel free to suggest the changes, and we'll review them.
from logbook.
Thanks @kasmarian . Honestly I had no expectations time-wise. More than a matter of time and desire, I'm lacking deeper knowledge on how things are structured. But I will take a look and who knows, if I get some idea I will shared of course 😉 Have a nice weekend!
from logbook.
Was also thinking that it also be good to be aware of the status code, if you are dealing with a response.
from logbook.
A BodyFilter
was meant to be just that, a filter for a message body. If you need more context or want to only apply something for requests but not responses, etc. then I'd argue you should use one of the lower-level abstractions like Request
- or ResponseFilter
.
from logbook.
Related Issues (20)
- mark/reset not supported after adding LogbookClientHttpRequestInterceptor with TRACE logging level HOT 1
- Allow automatic context propagation when using Spring Webflux
- Possible OOM with large servlet response HOT 6
- RESTEASY003765: Response is closed HOT 4
- URI in request log is missing slash character before path HOT 1
- [logbook-ktor-client] removes Content-Type request header HOT 2
- [logbook-ktor-client] Dead locks on large request/response bodies HOT 2
- [logbook-ktor-server] Content-Type header not parsed correctly from the request HOT 2
- spanId value in traceparent HTTP header not the same between outgoing/incoming requests HOT 6
- Make Logbook filter order configurable in Spring Boot starter HOT 1
- Default `QueryFilter` has a very slow RegEx on certain inputs HOT 2
- Wrong DateTime or I'm missing something config HOT 1
- BufferingClientHttpResponseWrapper incompatible with SpringBoot 2.7.x
- Invalid `Content-Length` of incoming request causes to java.util.concurrent.TimeoutException: Idle timeout expired
- Logbook with SpringBoot + Spring security 2.7.x fails to log unauthorized or forbidden responses
- Unable to read request body from ServletRequest twice because InputStream is getting exhausted after first use HOT 1
- Disable LogbookExchangeFilterFunction logging based on logbook property HOT 1
- ktor-client: response replaces request body
- logbook-logstash 3.9.0 requires slf4j 2.x which spring boot 3 depends on HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from logbook.