Class AuditEvent


  • public class AuditEvent
    extends Object
    Audit event that takes request and auth context as input to be able to audit log custom things. This interface may change in next release and is marked experimental
    Since:
    8.1.0
    WARNING: This API is experimental and might change in incompatible ways in the next release.
    • Constructor Detail

      • AuditEvent

        public AuditEvent​(AuditEvent.EventType eventType)
        Empty event, must be filled by user using setters. Message and Loglevel will be initialized from EventType but can be overridden with setters afterwards.
        Parameters:
        eventType - a predefined or custom EventType
      • AuditEvent

        public AuditEvent​(AuditEvent.EventType eventType,
                          javax.servlet.http.HttpServletRequest httpRequest)
      • AuditEvent

        protected AuditEvent()
      • AuditEvent

        public AuditEvent​(AuditEvent.EventType eventType,
                          Throwable exception,
                          javax.servlet.http.HttpServletRequest httpRequest)
        Event based on an HttpServletRequest, typically used during authentication. Solr will fill in details such as ip, http method etc from the request, and username if Principal exists on the request.
        Parameters:
        eventType - a predefined or custom EventType
        httpRequest - the request to initialize from
      • AuditEvent

        public AuditEvent​(AuditEvent.EventType eventType,
                          javax.servlet.http.HttpServletRequest httpRequest,
                          AuthorizationContext authorizationContext)
        Event based on request and AuthorizationContext. Solr will fill in details such as collections, ip, http method etc from the context.
        Parameters:
        eventType - a predefined or custom EventType
        httpRequest - the request to initialize from
        authorizationContext - the context to initialize from
      • AuditEvent

        public AuditEvent​(AuditEvent.EventType eventType,
                          javax.servlet.http.HttpServletRequest httpRequest,
                          AuthorizationContext authorizationContext,
                          double qTime,
                          Throwable exception)
        Event to log completed requests. Takes time and status. Solr will fill in details such as collections, ip, http method etc from the HTTP request and context.
        Parameters:
        eventType - a predefined or custom EventType
        httpRequest - the request to initialize from
        authorizationContext - the context to initialize from
        qTime - query time
        exception - exception from query response, or null if OK