Skip to content

AbstractRequestLoggingFilter and CommonsRequestLoggingFilter log level checks [SPR-12609] #17210

@spring-projects-issues

Description

@spring-projects-issues

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

Referenced from: commits d4dac25, bfba988

Metadata

Metadata

Assignees

Labels

in: coreIssues in core modules (aop, beans, core, context, expression)type: enhancementA general enhancement

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions