You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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:
AuditRequestLogger: Logs the HTTP and WebSocket requests and via Logback, streams these to Logstash (eg: for Kibana usage).
MetricRequestLogger: Logs the HTTP and WebSocket requests via their 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:
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.
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.
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: