Class AuditLogRecorder

java.lang.Object
org.odpi.openmetadata.frameworks.auditlog.AuditLogRecorder

public final class AuditLogRecorder extends Object
AuditLogRecorder writes audit log records to an audit log that may not have been supplied. When there is no audit log - for example, a connector that is running outside an OMAG Server, or the connector that is itself the destination for the audit log - the record is written to standard out instead. This means callers do not need to test for a null audit log before each message.

Classes that keep their audit log in a field use the logRecord/logExceptionRecord methods of their base class (AuditLoggingBase, or the framework base class that they extend). These static methods are for code that is passed the audit log as a parameter.
  • Method Details

    • logRecord

      public static void logRecord(AuditLog auditLog, String actionDescription, AuditLogMessageDefinition messageDefinition)
      Log an audit log record for an event, decision, error, or exception.
      Parameters:
      auditLog - logging destination - may be null
      actionDescription - calling method
      messageDefinition - description of the audit log record including specific resources involved
    • logRecord

      public static void logRecord(AuditLog auditLog, String actionDescription, AuditLogMessageDefinition messageDefinition, String additionalInformation)
      Log an audit log record for an event, decision, error, or exception, with supporting information.
      Parameters:
      auditLog - logging destination - may be null
      actionDescription - calling method
      messageDefinition - description of the audit log record including specific resources involved
      additionalInformation - supporting information
    • logExceptionRecord

      public static void logExceptionRecord(AuditLog auditLog, String actionDescription, AuditLogMessageDefinition messageDefinition, Throwable exception)
      Log an audit log record for an exception.
      Parameters:
      auditLog - logging destination - may be null
      actionDescription - calling method
      messageDefinition - description of the audit log record including specific resources involved
      exception - the exception associated with the message
    • logExceptionRecord

      public static void logExceptionRecord(AuditLog auditLog, String actionDescription, AuditLogMessageDefinition messageDefinition, String additionalInformation, Throwable exception)
      Log an audit log record for an exception, with supporting information.
      Parameters:
      auditLog - logging destination - may be null
      actionDescription - calling method
      messageDefinition - description of the audit log record including specific resources involved
      additionalInformation - supporting information
      exception - the exception associated with the message