+ public static void logAuditMessage(EELFLoggerDelegate classLogger, String message) {
+ MDC.put(EPCommonSystemProperties.AUDITLOG_BEGIN_TIMESTAMP, EPEELFLoggerAdvice.getCurrentDateTimeUTC());
+ MDC.put(EPCommonSystemProperties.AUDITLOG_END_TIMESTAMP, EPEELFLoggerAdvice.getCurrentDateTimeUTC());
+ EcompPortalUtils.calculateDateTimeDifferenceForLog(
+ MDC.get(EPCommonSystemProperties.AUDITLOG_BEGIN_TIMESTAMP),
+ MDC.get(EPCommonSystemProperties.AUDITLOG_END_TIMESTAMP));
+ MDC.put("CustomField1", "EXIT");
+ MDC.put("CustomField2", "InvocationID="+MDC.get(Configuration.MDC_KEY_REQUEST_ID));
+ try {
+ MDC.put(Configuration.MDC_SERVER_FQDN, InetAddress.getLocalHost().getCanonicalHostName());
+ } catch (Exception e) {
+ classLogger.logWrite(classLogger.errorLogger, Level.WARN, message, null, " exception while setting IP adress.");
+ }
+ MDC.put(EPCommonSystemProperties.STATUS_CODE, "COMPLETE");
+
+ classLogger.logWrite(classLogger.auditLogger, Level.INFO, message, null, null);
+ MDC.remove(Configuration.MDC_SERVER_FQDN);
+ MDC.remove(EPCommonSystemProperties.AUDITLOG_BEGIN_TIMESTAMP);
+ MDC.remove(EPCommonSystemProperties.AUDITLOG_END_TIMESTAMP);
+ MDC.remove(EPCommonSystemProperties.STATUS_CODE);
+ MDC.remove(SystemProperties.MDC_TIMER);
+ MDC.remove("CustomField1");
+ MDC.remove("CustomField2");
+ }
+
+