use of org.xdi.oxauth.audit.debug.entity.HttpRequest in project oxAuth by GluuFederation.
the class ServletLoggingFilter method getRequestDescription.
protected String getRequestDescription(RequestWrapper requestWrapper) {
HttpRequest httpRequest = new HttpRequest();
httpRequest.setSenderIP(requestWrapper.getLocalAddr());
httpRequest.setMethod(requestWrapper.getMethod());
httpRequest.setPath(requestWrapper.getRequestURI());
httpRequest.setParams(requestWrapper.isFormPost() ? null : requestWrapper.getParameters());
httpRequest.setHeaders(requestWrapper.getHeaders());
httpRequest.setBody(requestWrapper.getContent());
try {
return OBJECT_MAPPER.writeValueAsString(httpRequest);
} catch (JsonProcessingException e) {
log.warn("Cannot serialize Request to JSON", e);
return null;
}
}
Aggregations