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
    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
        event - the audit event
      • init

        public void init​(Map<String,​Object> pluginConfig)
        Initialize the plugin from security.json
        init in class AuditLoggerPlugin
        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.
        shouldLog in class AuditLoggerPlugin
        eventType - the event type to consider
        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
        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.