Comments (7)
This could be implemented by overriding (Default)HttpLogWriter.isActive and considering request uri there.
But this approach works at Logbook level and has no simple means to distinguish between incoming and outgoing requests.
from logbook.
Related to #47
from logbook.
The incoming/outgoing bisection could be achieved by using two Logbook configurations
from logbook.
If I understand you correctly 1 is proposing to enable further (custom) filtering inside the _LogbookFilter _ besides what filter registration allows?
While we'd have to do the same in every outgoing adapter (like logbook-httpclient) too, I think the filter and the adapters are the right place to do it, because then near-to-none runtime overhead for ignored URLs is added.
from logbook.
- Yes, first approach raises because there is no way to exclude urls using standard filter registration.
- Actually right now I like two Logbook conf and overriding HttpLogWriter.isActive approach, because then it is possible to configure logging of incoming and outgoing request differently (e.g. add "incoming" / "outgoing" marker) and exclusion/inclusion logic sits near Logbook conf and not in 100500 different filters/interceptors/etc
- Overhead should be considered later as it is premature optimization at this point.
- There could be also interesting usecases on response such as log only responses with certain code etc
from logbook.
- 👍
- I took a look at HttpLogWriter and it seems like isActive actually steers the buffering of requests/responses, so it seems we are fine there!
- Logbook potentially adds a non-marginal amount of overhead - therefore if it provides a "skip" feature there is a good chance users expect this to work in a way that skipped requests/responses are just "pass-through". We already have seen Logbook used in a high-volume live environment 😉 so IMO it make sense to think about it (but see 2).
- 👍
from logbook.
It's true, the isActive
method is the best place to do this right now, but I don't think it's the right place, conceptually. Right now we only have formatters and writers and they define the how and the where to respectively. E.g. the default writer just delegates to a logger and it implements isActive
by checking whether the logger is actually enabled for the level which is fine. If we start to throw in URL white/blacklists in there we are mixing different aspects/abstractions. I guess we need something new.
from logbook.
Related Issues (20)
- RESTEASY003765: Response is closed HOT 4
- URI in request log is missing slash character before path HOT 1
- Make body filters aware if they are dealing with a request or response HOT 6
- [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
- When the request method is x-www-form-urlencoded, Spring Boot cannot receive parameters using entity classes HOT 1
- Allow using multiple strategies for multiple set of paths HOT 3
- Missing Logging for Sent Requests During ReadTimeoutException in WebClient 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.