-
Notifications
You must be signed in to change notification settings - Fork 38.8k
Description
stephane cizeron opened SPR-12609 and commented
Hello,
The AbstractRequestLoggingFilter is very usefull but the perfomances could be improved. In fact, when a request is coming, a request message is created and after that, the log level check is done. Most of the time, the request message is useless. It's the same case for the response message (the "after request" message exactlty).
You could add the log level test :
protected void doFilterInternal(...) throws ServletException, IOException {
...
if (isFirstRequest && logger.isDebugEnabled()) {
beforeRequest(requestToUse, getBeforeMessage(requestToUse));
}
...
if (!isAsyncStarted(requestToUse) && logger.isDebugEnabled()) { afterRequest(requestToUse, getAfterMessage(requestToUse));
}
Regards
Stephane
Affects: 4.1.4