public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) throws IOException, ServletException {
if (audit && request instanceof HttpServletRequest) {
HttpServletRequest http = (HttpServletRequest)request;
AuditLogEntry entry = new HttpAuditLogEntry();
if (http.getRemoteUser() != null) {
entry.setUser(http.getRemoteUser());
}
entry.setTimestamp(System.currentTimeMillis());
entry.setOperation(http.getRequestURI());
entry.setRemoteAddr(http.getRemoteAddr());
entry.getParameters().put("params", http.getParameterMap());
auditLog.log(entry);
}
chain.doFilter(request, response);
}