>From 92b68d7ab3f58ad80a545f550f0598de2c43da2c Mon Sep 17 00:00:00 2001
From: "Endi S. Dewata" <edewata@redhat.com>
Date: Thu, 13 Apr 2017 01:45:37 +0200
Subject: [PATCH] Added methods to log AuditEvent object.

New audit(AuditEvent) methods have been added alongside the
existing audit(String) methods.

Change-Id: Ia02a7daa8b9e8693208fe34309d8d727cc32ce54
---
 base/ca/src/com/netscape/ca/CAService.java         | 10 ++++++++++
 .../src/com/netscape/kra/AsymKeyGenService.java    | 10 ++++++++++
 .../src/com/netscape/kra/EnrollmentService.java    | 10 ++++++++++
 .../src/com/netscape/kra/KeyRecoveryAuthority.java | 10 ++++++++++
 .../src/com/netscape/kra/NetkeyKeygenService.java  | 10 ++++++++++
 .../com/netscape/kra/SecurityDataProcessor.java    | 10 ++++++++++
 .../kra/src/com/netscape/kra/SymKeyGenService.java | 10 ++++++++++
 .../com/netscape/kra/TokenKeyRecoveryService.java  |  9 +++++++++
 .../com/netscape/cms/authentication/CMCAuth.java   | 10 ++++++++++
 .../cms/src/com/netscape/cms/logging/LogFile.java  | 10 ++++++++++
 .../netscape/cms/profile/common/BasicProfile.java  | 11 +++++++++++
 .../netscape/cms/profile/input/EnrollInput.java    | 10 ++++++++++
 .../cms/profile/updater/SubsystemGroupUpdater.java | 14 +++++++++++--
 .../cms/src/com/netscape/cms/realm/PKIRealm.java   | 10 ++++++++++
 .../com/netscape/cms/servlet/base/CMSServlet.java  | 10 ++++++++++
 .../cms/servlet/connector/ConnectorServlet.java    | 10 ++++++++++
 .../cms/servlet/processors/CAProcessor.java        | 10 ++++++++++
 .../cms/servlet/processors/PKIProcessor.java       | 23 ++++++++++++++++------
 .../org/dogtagpki/server/rest/ACLInterceptor.java  | 10 ++++++++++
 .../src/com/netscape/cmscore/cert/CertUtils.java   | 10 ++++++++++
 .../src/com/netscape/cmscore/logging/Auditor.java  | 11 +++++++++++
 .../cmscore/selftests/SelfTestSubsystem.java       | 10 ++++++++++
 .../server/tps/processor/TPSProcessor.java         | 10 ++++++++++
 23 files changed, 240 insertions(+), 8 deletions(-)

diff --git a/base/ca/src/com/netscape/ca/CAService.java b/base/ca/src/com/netscape/ca/CAService.java
index 5b364b85c2fef05c19d223b87a645168295ce80e..2ad196720ea59d145b0637866b5b1526ec8b1a89 100644
--- a/base/ca/src/com/netscape/ca/CAService.java
+++ b/base/ca/src/com/netscape/ca/CAService.java
@@ -1177,6 +1177,16 @@ public class CAService implements ICAService, IService {
                 msg);
     }
 
+    protected void audit(AuditEvent event) {
+
+        String template = event.getMessage();
+        Object[] params = event.getParameters();
+
+        String message = CMS.getLogMessage(template, params);
+
+        audit(message);
+    }
+
     /**
      * Signed Audit Log Subject ID
      *
diff --git a/base/kra/src/com/netscape/kra/AsymKeyGenService.java b/base/kra/src/com/netscape/kra/AsymKeyGenService.java
index 75e340cd32c6b228fb7546772ada2c94f95e295f..bd2be704dec410051643ccba28bd1a75edb8ec53 100644
--- a/base/kra/src/com/netscape/kra/AsymKeyGenService.java
+++ b/base/kra/src/com/netscape/kra/AsymKeyGenService.java
@@ -228,6 +228,16 @@ public class AsymKeyGenService implements IService {
                 msg);
     }
 
+    protected void audit(AuditEvent event) {
+
+        String template = event.getMessage();
+        Object[] params = event.getParameters();
+
+        String message = CMS.getLogMessage(template, params);
+
+        audit(message);
+    }
+
     private void auditAsymKeyGenRequestProcessed(String subjectID, String status, RequestId requestID,
             String clientKeyID,
             String keyID, String reason) {
diff --git a/base/kra/src/com/netscape/kra/EnrollmentService.java b/base/kra/src/com/netscape/kra/EnrollmentService.java
index d2748a2180e812198c5f256b0abf01dd346b426c..7c179d4bdbc00eb957e092c6c8519f625d36be93 100644
--- a/base/kra/src/com/netscape/kra/EnrollmentService.java
+++ b/base/kra/src/com/netscape/kra/EnrollmentService.java
@@ -1034,4 +1034,14 @@ public class EnrollmentService implements IService {
                 ILogger.LL_SECURITY,
                 msg);
     }
+
+    protected void audit(AuditEvent event) {
+
+        String template = event.getMessage();
+        Object[] params = event.getParameters();
+
+        String message = CMS.getLogMessage(template, params);
+
+        audit(message);
+    }
 }
diff --git a/base/kra/src/com/netscape/kra/KeyRecoveryAuthority.java b/base/kra/src/com/netscape/kra/KeyRecoveryAuthority.java
index b6e437655e389218eaeef3ef40d98ea69380222d..1df04db1bc32f9f2c49af48e6c558db9e148c1de 100644
--- a/base/kra/src/com/netscape/kra/KeyRecoveryAuthority.java
+++ b/base/kra/src/com/netscape/kra/KeyRecoveryAuthority.java
@@ -1570,6 +1570,16 @@ public class KeyRecoveryAuthority implements IAuthority, IKeyService, IKeyRecove
                 msg);
     }
 
+    protected void audit(AuditEvent event) {
+
+        String template = event.getMessage();
+        Object[] params = event.getParameters();
+
+        String message = CMS.getLogMessage(template, params);
+
+        audit(message);
+    }
+
     /**
      * Signed Audit Log Subject ID
      *
diff --git a/base/kra/src/com/netscape/kra/NetkeyKeygenService.java b/base/kra/src/com/netscape/kra/NetkeyKeygenService.java
index 665ff19372c70ed134b148a345e6167b08b8bc13..4926873e27065cd1fa81aa83a928df4c69fddeaa 100644
--- a/base/kra/src/com/netscape/kra/NetkeyKeygenService.java
+++ b/base/kra/src/com/netscape/kra/NetkeyKeygenService.java
@@ -708,4 +708,14 @@ public class NetkeyKeygenService implements IService {
                 ILogger.LL_SECURITY,
                 msg);
     }
+
+    protected void audit(AuditEvent event) {
+
+        String template = event.getMessage();
+        Object[] params = event.getParameters();
+
+        String message = CMS.getLogMessage(template, params);
+
+        audit(message);
+    }
 }
diff --git a/base/kra/src/com/netscape/kra/SecurityDataProcessor.java b/base/kra/src/com/netscape/kra/SecurityDataProcessor.java
index 78d64c53ea98430d2ef3bd382a938364ce74acf6..05dccb9c043fdabaf9edac2f0b956090d45424e6 100644
--- a/base/kra/src/com/netscape/kra/SecurityDataProcessor.java
+++ b/base/kra/src/com/netscape/kra/SecurityDataProcessor.java
@@ -770,6 +770,16 @@ public class SecurityDataProcessor {
                 msg);
     }
 
+    protected void audit(AuditEvent event) {
+
+        String template = event.getMessage();
+        Object[] params = event.getParameters();
+
+        String message = CMS.getLogMessage(template, params);
+
+        audit(message);
+    }
+
     private void auditRecoveryRequestProcessed(String subjectID, String status, RequestId requestID,
             String keyID, String reason) {
         String auditMessage = CMS.getLogMessage(
diff --git a/base/kra/src/com/netscape/kra/SymKeyGenService.java b/base/kra/src/com/netscape/kra/SymKeyGenService.java
index f700a79054c8351f4a40fb05d5733dc55685837c..0dfd3a292ad06f82e27ac73d5d47d9bb1dc7a3c9 100644
--- a/base/kra/src/com/netscape/kra/SymKeyGenService.java
+++ b/base/kra/src/com/netscape/kra/SymKeyGenService.java
@@ -247,6 +247,16 @@ public class SymKeyGenService implements IService {
                 msg);
     }
 
+    protected void audit(AuditEvent event) {
+
+        String template = event.getMessage();
+        Object[] params = event.getParameters();
+
+        String message = CMS.getLogMessage(template, params);
+
+        audit(message);
+    }
+
     private void auditSymKeyGenRequestProcessed(String subjectID, String status, RequestId requestID, String clientKeyID,
             String keyID, String reason) {
         String auditMessage = CMS.getLogMessage(
diff --git a/base/kra/src/com/netscape/kra/TokenKeyRecoveryService.java b/base/kra/src/com/netscape/kra/TokenKeyRecoveryService.java
index b710291cec4cf854954ef25192679ac4a7a62fb3..67f4dc60da7ce4b838229d18da82c2992f4c6dd3 100644
--- a/base/kra/src/com/netscape/kra/TokenKeyRecoveryService.java
+++ b/base/kra/src/com/netscape/kra/TokenKeyRecoveryService.java
@@ -733,4 +733,13 @@ public class TokenKeyRecoveryService implements IService {
                 msg);
     }
 
+    protected void audit(AuditEvent event) {
+
+        String template = event.getMessage();
+        Object[] params = event.getParameters();
+
+        String message = CMS.getLogMessage(template, params);
+
+        audit(message);
+    }
 }
diff --git a/base/server/cms/src/com/netscape/cms/authentication/CMCAuth.java b/base/server/cms/src/com/netscape/cms/authentication/CMCAuth.java
index 02aceb4b32809f6019932981717c202653595308..b8983531a0ba6f27b5f3816aa898d5709e18a6fa 100644
--- a/base/server/cms/src/com/netscape/cms/authentication/CMCAuth.java
+++ b/base/server/cms/src/com/netscape/cms/authentication/CMCAuth.java
@@ -1073,6 +1073,16 @@ public class CMCAuth implements IAuthManager, IExtendedPluginInfo,
                 msg);
     }
 
+    protected void audit(AuditEvent event) {
+
+        String template = event.getMessage();
+        Object[] params = event.getParameters();
+
+        String message = CMS.getLogMessage(template, params);
+
+        audit(message);
+    }
+
     /**
      * Signed Audit Log Subject ID
      *
diff --git a/base/server/cms/src/com/netscape/cms/logging/LogFile.java b/base/server/cms/src/com/netscape/cms/logging/LogFile.java
index 989fece2e78b70c4e6c0b7b789b1d264fcecb219..772607edd53dc55bd10e26b8098385a93cc95c73 100644
--- a/base/server/cms/src/com/netscape/cms/logging/LogFile.java
+++ b/base/server/cms/src/com/netscape/cms/logging/LogFile.java
@@ -1541,4 +1541,14 @@ public class LogFile implements ILogEventListener, IExtendedPluginInfo {
                                 ILogger.LL_SECURITY,
                                 msg);
     }
+
+    protected void audit(AuditEvent event) {
+
+        String template = event.getMessage();
+        Object[] params = event.getParameters();
+
+        String message = CMS.getLogMessage(template, params);
+
+        audit(message);
+    }
 }
diff --git a/base/server/cms/src/com/netscape/cms/profile/common/BasicProfile.java b/base/server/cms/src/com/netscape/cms/profile/common/BasicProfile.java
index ff97bfa6ce395fcf70ff9e39b0cd47f9416e2493..e6fc045e5d94a50382f0e6107fc2607a58101a85 100644
--- a/base/server/cms/src/com/netscape/cms/profile/common/BasicProfile.java
+++ b/base/server/cms/src/com/netscape/cms/profile/common/BasicProfile.java
@@ -30,6 +30,7 @@ import com.netscape.certsrv.base.EBaseException;
 import com.netscape.certsrv.base.IConfigStore;
 import com.netscape.certsrv.base.SessionContext;
 import com.netscape.certsrv.common.NameValuePairs;
+import com.netscape.certsrv.logging.AuditEvent;
 import com.netscape.certsrv.logging.ILogger;
 import com.netscape.certsrv.profile.EProfileException;
 import com.netscape.certsrv.profile.ERejectException;
@@ -1173,6 +1174,16 @@ public abstract class BasicProfile implements IProfile {
                 msg);
     }
 
+    protected void audit(AuditEvent event) {
+
+        String template = event.getMessage();
+        Object[] params = event.getParameters();
+
+        String message = CMS.getLogMessage(template, params);
+
+        audit(message);
+    }
+
     /**
      * Signed Audit Log Subject ID
      *
diff --git a/base/server/cms/src/com/netscape/cms/profile/input/EnrollInput.java b/base/server/cms/src/com/netscape/cms/profile/input/EnrollInput.java
index 81e71c49efcd070298e36cdd35687c6d4a4c8a8d..84a639800498c8bfb94ae7577e6c728813c66dda 100644
--- a/base/server/cms/src/com/netscape/cms/profile/input/EnrollInput.java
+++ b/base/server/cms/src/com/netscape/cms/profile/input/EnrollInput.java
@@ -263,6 +263,16 @@ public abstract class EnrollInput implements IProfileInput {
                 msg);
     }
 
+    protected void audit(AuditEvent event) {
+
+        String template = event.getMessage();
+        Object[] params = event.getParameters();
+
+        String message = CMS.getLogMessage(template, params);
+
+        audit(message);
+    }
+
     /**
      * Signed Audit Log Subject ID
      *
diff --git a/base/server/cms/src/com/netscape/cms/profile/updater/SubsystemGroupUpdater.java b/base/server/cms/src/com/netscape/cms/profile/updater/SubsystemGroupUpdater.java
index 2f47efad9fa10c2746364ebb8fe89dca114475c7..7daa8e4d9b3307b1a99ff38e9c8f577fa182bcb7 100644
--- a/base/server/cms/src/com/netscape/cms/profile/updater/SubsystemGroupUpdater.java
+++ b/base/server/cms/src/com/netscape/cms/profile/updater/SubsystemGroupUpdater.java
@@ -21,8 +21,6 @@ import java.util.Enumeration;
 import java.util.Locale;
 import java.util.Vector;
 
-import netscape.security.x509.X509CertImpl;
-
 import com.netscape.certsrv.apps.CMS;
 import com.netscape.certsrv.base.ConflictingOperationException;
 import com.netscape.certsrv.base.EBaseException;
@@ -42,6 +40,8 @@ import com.netscape.certsrv.usrgrp.IGroup;
 import com.netscape.certsrv.usrgrp.IUGSubsystem;
 import com.netscape.certsrv.usrgrp.IUser;
 
+import netscape.security.x509.X509CertImpl;
+
 /**
  * This updater class will create the new user to the subsystem group and
  * then add the subsystem certificate to the user.
@@ -279,6 +279,16 @@ public class SubsystemGroupUpdater implements IProfileUpdater {
                 msg);
     }
 
+    protected void audit(AuditEvent event) {
+
+        String template = event.getMessage();
+        Object[] params = event.getParameters();
+
+        String message = CMS.getLogMessage(template, params);
+
+        audit(message);
+    }
+
     private String auditSubjectID() {
         if (mSignedAuditLogger == null) {
             return null;
diff --git a/base/server/cms/src/com/netscape/cms/realm/PKIRealm.java b/base/server/cms/src/com/netscape/cms/realm/PKIRealm.java
index 28fb0b9be94a4e2ebecf4cae6f96dc98efc5dd54..bcd3ff848e6c7b88b0efca3b4532fbab0f2b2c7e 100644
--- a/base/server/cms/src/com/netscape/cms/realm/PKIRealm.java
+++ b/base/server/cms/src/com/netscape/cms/realm/PKIRealm.java
@@ -227,4 +227,14 @@ public class PKIRealm extends RealmBase {
                 ILogger.LL_SECURITY,
                 msg);
     }
+
+    protected void audit(AuditEvent event) {
+
+        String template = event.getMessage();
+        Object[] params = event.getParameters();
+
+        String message = CMS.getLogMessage(template, params);
+
+        audit(message);
+    }
 }
diff --git a/base/server/cms/src/com/netscape/cms/servlet/base/CMSServlet.java b/base/server/cms/src/com/netscape/cms/servlet/base/CMSServlet.java
index c7fc03b440fb6f5fcaef61f5f2071b8723f41a07..a007a008b68267988798e1f5007a003bc8331736 100644
--- a/base/server/cms/src/com/netscape/cms/servlet/base/CMSServlet.java
+++ b/base/server/cms/src/com/netscape/cms/servlet/base/CMSServlet.java
@@ -2068,6 +2068,16 @@ public abstract class CMSServlet extends HttpServlet {
                 msg);
     }
 
+    protected void audit(AuditEvent event) {
+
+        String template = event.getMessage();
+        Object[] params = event.getParameters();
+
+        String message = CMS.getLogMessage(template, params);
+
+        audit(message);
+    }
+
     /**
      * Signed Audit Log Subject ID
      *
diff --git a/base/server/cms/src/com/netscape/cms/servlet/connector/ConnectorServlet.java b/base/server/cms/src/com/netscape/cms/servlet/connector/ConnectorServlet.java
index 2299e607975f2bba0417082ddfe551eac1754a3e..13c732b2f0766a397e8ef458d99920d2f8cc0def 100644
--- a/base/server/cms/src/com/netscape/cms/servlet/connector/ConnectorServlet.java
+++ b/base/server/cms/src/com/netscape/cms/servlet/connector/ConnectorServlet.java
@@ -1025,6 +1025,16 @@ public class ConnectorServlet extends CMSServlet {
                 msg);
     }
 
+    protected void audit(AuditEvent event) {
+
+        String template = event.getMessage();
+        Object[] params = event.getParameters();
+
+        String message = CMS.getLogMessage(template, params);
+
+        audit(message);
+    }
+
     /**
      * Signed Audit Log Profile ID
      *
diff --git a/base/server/cms/src/com/netscape/cms/servlet/processors/CAProcessor.java b/base/server/cms/src/com/netscape/cms/servlet/processors/CAProcessor.java
index ad79cbbf0952cea922db370f865d0dd7eaa55fe3..8c4fef12eed9bf79a149a141689a52c007dab946 100644
--- a/base/server/cms/src/com/netscape/cms/servlet/processors/CAProcessor.java
+++ b/base/server/cms/src/com/netscape/cms/servlet/processors/CAProcessor.java
@@ -945,6 +945,16 @@ public class CAProcessor extends Processor {
                 msg);
     }
 
+    protected void audit(AuditEvent event) {
+
+        String template = event.getMessage();
+        Object[] params = event.getParameters();
+
+        String message = CMS.getLogMessage(template, params);
+
+        audit(message);
+    }
+
     /**
      * Signed Audit Log Requester ID
      *
diff --git a/base/server/cms/src/com/netscape/cms/servlet/processors/PKIProcessor.java b/base/server/cms/src/com/netscape/cms/servlet/processors/PKIProcessor.java
index bea899368dd76d9f2a481dd2dbcd09b25c58815c..e6ee2db90f958dd4713d0f4201b968a41ceeb2a9 100644
--- a/base/server/cms/src/com/netscape/cms/servlet/processors/PKIProcessor.java
+++ b/base/server/cms/src/com/netscape/cms/servlet/processors/PKIProcessor.java
@@ -23,12 +23,6 @@ import java.util.Date;
 
 import javax.servlet.http.HttpServletRequest;
 
-import netscape.security.x509.CertificateExtensions;
-import netscape.security.x509.CertificateSubjectName;
-import netscape.security.x509.CertificateValidity;
-import netscape.security.x509.X500Name;
-import netscape.security.x509.X509CertInfo;
-
 import com.netscape.certsrv.apps.CMS;
 import com.netscape.certsrv.authentication.AuthToken;
 import com.netscape.certsrv.authentication.IAuthToken;
@@ -36,11 +30,18 @@ import com.netscape.certsrv.base.EBaseException;
 import com.netscape.certsrv.base.IArgBlock;
 import com.netscape.certsrv.base.SessionContext;
 import com.netscape.certsrv.common.ICMSRequest;
+import com.netscape.certsrv.logging.AuditEvent;
 import com.netscape.certsrv.logging.ILogger;
 import com.netscape.certsrv.request.IRequest;
 import com.netscape.cms.servlet.base.CMSServlet;
 import com.netscape.cms.servlet.common.ECMSGWException;
 
+import netscape.security.x509.CertificateExtensions;
+import netscape.security.x509.CertificateSubjectName;
+import netscape.security.x509.CertificateValidity;
+import netscape.security.x509.X500Name;
+import netscape.security.x509.X509CertInfo;
+
 /**
  * Process Certificate Requests
  *
@@ -316,6 +317,16 @@ public class PKIProcessor implements IPKIProcessor {
                 msg);
     }
 
+    protected void audit(AuditEvent event) {
+
+        String template = event.getMessage();
+        Object[] params = event.getParameters();
+
+        String message = CMS.getLogMessage(template, params);
+
+        audit(message);
+    }
+
     /**
      * Signed Audit Log Subject ID
      *
diff --git a/base/server/cms/src/org/dogtagpki/server/rest/ACLInterceptor.java b/base/server/cms/src/org/dogtagpki/server/rest/ACLInterceptor.java
index 86996d5b204d1256ded7a5b6b85d062967d4f760..331bae1605ecad5af4733f191535592fe13699b1 100644
--- a/base/server/cms/src/org/dogtagpki/server/rest/ACLInterceptor.java
+++ b/base/server/cms/src/org/dogtagpki/server/rest/ACLInterceptor.java
@@ -351,4 +351,14 @@ public class ACLInterceptor implements ContainerRequestFilter {
                 ILogger.LL_SECURITY,
                 msg);
     }
+
+    protected void audit(AuditEvent event) {
+
+        String template = event.getMessage();
+        Object[] params = event.getParameters();
+
+        String message = CMS.getLogMessage(template, params);
+
+        audit(message);
+    }
 }
diff --git a/base/server/cmscore/src/com/netscape/cmscore/cert/CertUtils.java b/base/server/cmscore/src/com/netscape/cmscore/cert/CertUtils.java
index e1c4c760741bc77945e301ec6b4c66d31689dd1d..6691f7ab55891ae51cf467eea472cd02d2d16248 100644
--- a/base/server/cmscore/src/com/netscape/cmscore/cert/CertUtils.java
+++ b/base/server/cmscore/src/com/netscape/cmscore/cert/CertUtils.java
@@ -1102,4 +1102,14 @@ public class CertUtils {
                 msg);
     }
 
+    protected void audit(AuditEvent event) {
+
+        String template = event.getMessage();
+        Object[] params = event.getParameters();
+
+        String message = CMS.getLogMessage(template, params);
+
+        audit(message);
+    }
+
 }
diff --git a/base/server/cmscore/src/com/netscape/cmscore/logging/Auditor.java b/base/server/cmscore/src/com/netscape/cmscore/logging/Auditor.java
index 8c99e676cc4d8acab36e90b3748fb7d9db7984ec..48dfe3a884287f2c48207d66888d7021023260a4 100644
--- a/base/server/cmscore/src/com/netscape/cmscore/logging/Auditor.java
+++ b/base/server/cmscore/src/com/netscape/cmscore/logging/Auditor.java
@@ -24,6 +24,7 @@ import java.util.Map;
 import com.netscape.certsrv.apps.CMS;
 import com.netscape.certsrv.base.SessionContext;
 import com.netscape.certsrv.common.Constants;
+import com.netscape.certsrv.logging.AuditEvent;
 import com.netscape.certsrv.logging.IAuditor;
 import com.netscape.certsrv.logging.ILogger;
 import com.netscape.certsrv.usrgrp.IGroup;
@@ -218,4 +219,14 @@ public class Auditor implements IAuditor {
                 ILogger.LL_SECURITY,
                 message);
     }
+
+    protected void audit(AuditEvent event) {
+
+        String template = event.getMessage();
+        Object[] params = event.getParameters();
+
+        String message = CMS.getLogMessage(template, params);
+
+        log(message);
+    }
 }
diff --git a/base/server/cmscore/src/com/netscape/cmscore/selftests/SelfTestSubsystem.java b/base/server/cmscore/src/com/netscape/cmscore/selftests/SelfTestSubsystem.java
index 95556b9c636f192485f0bcf5009a53a875839d29..6ee3176c23bbe2efa637f2c4a735d5b112866da4 100644
--- a/base/server/cmscore/src/com/netscape/cmscore/selftests/SelfTestSubsystem.java
+++ b/base/server/cmscore/src/com/netscape/cmscore/selftests/SelfTestSubsystem.java
@@ -127,6 +127,16 @@ public class SelfTestSubsystem
                 msg);
     }
 
+    protected void audit(AuditEvent event) {
+
+        String template = event.getMessage();
+        Object[] params = event.getParameters();
+
+        String message = CMS.getLogMessage(template, params);
+
+        audit(message);
+    }
+
     /**
      * This helper method returns the "full" property name (the corresponding
      * substore name prepended in front of the plugin/parameter name). This
diff --git a/base/tps/src/org/dogtagpki/server/tps/processor/TPSProcessor.java b/base/tps/src/org/dogtagpki/server/tps/processor/TPSProcessor.java
index 910a26371d385d0d6bde6bd838780c5ee6334c4f..0cfac59190eb0c0cb42e4a90faf00fad3a8ef2c4 100644
--- a/base/tps/src/org/dogtagpki/server/tps/processor/TPSProcessor.java
+++ b/base/tps/src/org/dogtagpki/server/tps/processor/TPSProcessor.java
@@ -4264,6 +4264,16 @@ public class TPSProcessor {
                 msg);
     }
 
+    protected void audit(AuditEvent event) {
+
+        String template = event.getMessage();
+        Object[] params = event.getParameters();
+
+        String message = CMS.getLogMessage(template, params);
+
+        audit(message);
+    }
+
     public static void main(String[] args) {
     }
 
-- 
2.9.3

