I have a lift project in which
there is a class extending RestHelper that looks like this
serve{
"api" / "mystuff" prefix {
case a => ...
case b => ...
}
}
How can i log all the requests(including POST parameters) and responses without adding it to each case statement?
To log the requests you can use LiftRules.statelessRewrite (in bootstrap.liftweb.Boot):
That will be intercepted before the following rest server:
Note that url params are kept.
To log the responses you use
LiftRules.afterSendUPDATE:
Using afterSend you can actually access both request and response.