- // Log file
- MDC.put(EPCommonSystemProperties.AUDITLOG_END_TIMESTAMP, EPEELFLoggerAdvice.getCurrentDateTimeUTC());
- SimpleDateFormat ecompLogDateFormat = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSSXXX");
- String beginDateTime = MDC.get(EPCommonSystemProperties.AUDITLOG_BEGIN_TIMESTAMP);
- Date beginDate = ecompLogDateFormat.parse(beginDateTime);
- auditService.logActivity(auditLog, null);
- String endDateTime = MDC.get(EPCommonSystemProperties.AUDITLOG_END_TIMESTAMP);
- Date endDate = ecompLogDateFormat.parse(endDateTime);
- String timeDifference = String.format("%d", endDate.getTime() - beginDate.getTime());
- MDC.put(SystemProperties.MDC_TIMER, timeDifference);
- MDC.put(EPCommonSystemProperties.STATUS_CODE, "COMPLETE");
- logger.info(EELFLoggerDelegate.auditLogger, EPLogUtil.formatAuditLogMessage(
- "AuditLogController.auditLog", cdType, user.getOrgUserId(), affectedAppId, comment));
- MDC.remove(EPCommonSystemProperties.AUDITLOG_BEGIN_TIMESTAMP);
- MDC.remove(EPCommonSystemProperties.AUDITLOG_END_TIMESTAMP);
+ String auditMessageInfo = EPLogUtil.formatAuditLogMessage(
+ "AuditLogController.auditLog", cdType, user.getOrgUserId(), affectedAppId, comment);
+
+ EPLogUtil.logAuditMessage(logger, auditMessageInfo);
+