if (CapString.isEmpty(ipAddress)){
ServletRequest req = params.getServletRequest();
ipAddress = req.getRemoteAddr();
}
AuditLog auditLog = null;
if (haveToAudit) {
auditLog = new AuditLog();
auditLog.setId(UUIDGenerator.getUUID());
auditLog.setUserId(uid);
auditLog.setIpAddress(trimByLen(CapString.trimNull(ipAddress), 50));
auditLog.setFunctionId(trimByLen(function, 20));
auditLog.setAction(trimByLen(action.toLowerCase(), 20));
// auditLog.setRemark(trimByLen(CapString.trimNull(params.toString()),
// 50));
long tstart = NumberUtils.toLong(CapString.trimNull(params
.get(CapConstants.C_AUDITLOG_START_TS)));
if (tstart > 0) {
auditLog.setExecuteDate(new Timestamp(tstart));
if (LOGGER.isTraceEnabled()) {
LOGGER.trace("{} AuditLog={}", TITLE, auditLog);
}
}
}