-
-
Notifications
You must be signed in to change notification settings - Fork 557
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
Support for multiple Request Loggers #2219
Comments
What would be the advantage of handing this in Javalin's side over doing the same in user code? Should be simple enough to aggregate loggers on your side, if it were the case. |
As @zugazagoitia points out, this does seem very solvable - is there something we're not seeing @LoonyRules ? |
Just a nicer developer experience really, nothing more than that. For example, I've had to implement a similar thing twice already, whereas I wouldn't have to if it was just supported out of the box. Happy for it to be rejected if you feel like it's too out of scope. |
Super easy to implement on our side too 🤔 Let's keep it open for a while and see if we come up with any reason to not do it. |
Describe the feature
It would be great if we could register multiple Request Loggers, just like we do right now for registering
.beforeMatched(...)
handlers.This would allows us to separate logging into specific domain classes and also helps with unit tests, for example:
matchedPath()
's for tracking Metrics.Additional context
I think the current way of registering request loggers is perfectly fine, and that under-the-hood, Javalin should just use a collection of request loggers that it executes in order. When doing this, if 1 Request Logger throws an exception, the other Request Loggers should still be invoked.
The text was updated successfully, but these errors were encountered: