How to log request/response

73 views
Skip to first unread message

Tomas Hudec

unread,
Mar 3, 2014, 7:42:04 AM3/3/14
to extdire...@googlegroups.com
Hi,

I need to log request and respon to audit log. Is there some class which log request and response ? Something like:

log4j.additivity.org.springframework.ws.server.MessageTracing=false
log4j.logger.org.springframework.ws.server.MessageTracing=TRACE
log4j.additivity.org.springframework.ws.client.MessageTracing=false
log4j.logger.org.springframework.ws.client.MessageTracing=TRACE

in spring

Thx for help

Ralph Schaer

unread,
Mar 3, 2014, 7:45:57 AM3/3/14
to extdire...@googlegroups.com
Hi

If you want to log extdirect requests and responses you could do it with aop.
There is a description in this message:


Tomas Hudec

unread,
Mar 4, 2014, 6:52:55 AM3/4/14
to extdire...@googlegroups.com
I have no idea how this helps me. How I can get request when I intercept your methods ?

Dňa pondelok, 3. marca 2014 13:42:04 UTC+1 Tomas Hudec napísal(-a):

Ralph Schaer

unread,
Mar 4, 2014, 7:25:01 AM3/4/14
to extdire...@googlegroups.com
Hi

It depends what you are trying to achieve. If you want to log extdirectcalls you can do it this way. 
A spring mvc application can retrieve the http request with the RequestContextHolder.
((ServletRequestAttributes) RequestContextHolder.currentRequestAttributes()).getRequest()

Or if you want to log every request/response a filter may be the better approach. Here is a project that implements such a logging filter: https://github.com/isrsal/spring-mvc-logger 


Reply all
Reply to author
Forward
0 new messages