Class MultiDestinationAuditLogger

  • All Implemented Interfaces:
    Closeable, AutoCloseable, Runnable, org.apache.lucene.analysis.util.ResourceLoaderAware, SolrInfoBean, SolrMetricProducer

    public class MultiDestinationAuditLogger
    extends AuditLoggerPlugin
    implements org.apache.lucene.analysis.util.ResourceLoaderAware
    Audit logger that chains other loggers. Lets you configure logging to multiple destinations. The config is simply a list of configs for the sub plugins:
       "class" : "solr.MultiDestinationAuditLogger",
       "plugins" : [
         { "class" : "solr.SolrLogAuditLoggerPlugin" },
         { "class" : "solr.MyOtherAuditPlugin"}
       ]
     
    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

      • MultiDestinationAuditLogger

        public MultiDestinationAuditLogger()
    • Method Detail

      • audit

        public void audit​(AuditEvent event)
        Passes the AuditEvent to all sub plugins in parallel. The event should be a AuditEvent to be able to pull context info.
        Specified by:
        audit in class AuditLoggerPlugin
        Parameters:
        event - the audit event
      • init

        public void init​(Map<String,​Object> pluginConfig)
        Initialize the plugin from security.json
        Overrides:
        init in class AuditLoggerPlugin
        Parameters:
        pluginConfig - the config for the plugin
      • shouldLog

        public boolean shouldLog​(AuditEvent.EventType eventType)
        Description copied from class: AuditLoggerPlugin
        Checks whether this event type should be logged based on "eventTypes" config parameter.
        Overrides:
        shouldLog in class AuditLoggerPlugin
        Parameters:
        eventType - the event type to consider
        Returns:
        true if this event type should be logged
      • inform

        public void inform​(org.apache.lucene.analysis.util.ResourceLoader loader)
        Specified by:
        inform in interface org.apache.lucene.analysis.util.ResourceLoaderAware
      • initializeMetrics

        public void initializeMetrics​(SolrMetricManager manager,
                                      String registryName,
                                      String tag,
                                      String scope)
        Description copied from interface: SolrMetricProducer
        Initializes metrics specific to this producer
        Specified by:
        initializeMetrics in interface SolrMetricProducer
        Parameters:
        manager - an instance of SolrMetricManager
        registryName - registry name where metrics are registered
        tag - a symbolic tag that represents this instance of the producer, or a group of related instances that have the same life-cycle. This tag is used when managing life-cycle of some metrics.
        scope - scope of the metrics (eg. handler name) to separate metrics of components with the same implementation but different scope.