Package org.apache.solr.security
Class MultiDestinationAuditLogger
- java.lang.Object
- 
- org.apache.solr.security.AuditLoggerPlugin
- 
- org.apache.solr.security.MultiDestinationAuditLogger
 
 
- 
- All Implemented Interfaces:
- Closeable,- AutoCloseable,- Runnable,- org.apache.lucene.util.ResourceLoaderAware,- SolrInfoBean,- SolrMetricProducer
 
 public class MultiDestinationAuditLogger extends AuditLoggerPlugin implements org.apache.lucene.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.
 
- 
- 
Nested Class Summary- 
Nested classes/interfaces inherited from class org.apache.solr.security.AuditLoggerPluginAuditLoggerPlugin.AuditEventFormatter, AuditLoggerPlugin.JSONAuditEventFormatter, AuditLoggerPlugin.MuteRule
 - 
Nested classes/interfaces inherited from interface org.apache.solr.core.SolrInfoBeanSolrInfoBean.Category, SolrInfoBean.Group
 
- 
 - 
Field Summary- 
Fields inherited from class org.apache.solr.security.AuditLoggerPlugineventTypes, formatter, numErrors, numLogged, numLost, queuedTime, requestTimes, totalTime
 
- 
 - 
Constructor SummaryConstructors Constructor Description MultiDestinationAuditLogger()
 - 
Method SummaryAll Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaudit(AuditEvent event)Passes the AuditEvent to all sub plugins in parallel.voidclose()Waits 30s for async queue to drain, then closes executor threads.voidinform(org.apache.lucene.util.ResourceLoader loader)voidinit(Map<String,Object> pluginConfig)Initialize the plugin from security.jsonvoidinitializeMetrics(SolrMetricsContext parentContext, String scope)Initialize metrics specific to this producer.booleanshouldLog(AuditEvent.EventType eventType)Checks whether this event type should be logged based on "eventTypes" config parameter.- 
Methods inherited from class org.apache.solr.security.AuditLoggerPluginauditAsync, doAudit, getCategory, getDescription, getName, getSolrMetricsContext, run, setFormatter, shouldMute, waitForQueueToDrain
 
- 
 
- 
- 
- 
Method Detail- 
auditpublic void audit(AuditEvent event) Passes the AuditEvent to all sub plugins in parallel. The event should be aAuditEventto be able to pull context info.- Specified by:
- auditin class- AuditLoggerPlugin
- Parameters:
- event- the audit event
 
 - 
initpublic void init(Map<String,Object> pluginConfig) Initialize the plugin from security.json- Overrides:
- initin class- AuditLoggerPlugin
- Parameters:
- pluginConfig- the config for the plugin
 
 - 
shouldLogpublic boolean shouldLog(AuditEvent.EventType eventType) Description copied from class:AuditLoggerPluginChecks whether this event type should be logged based on "eventTypes" config parameter.- Overrides:
- shouldLogin class- AuditLoggerPlugin
- Parameters:
- eventType- the event type to consider
- Returns:
- true if this event type should be logged
 
 - 
informpublic void inform(org.apache.lucene.util.ResourceLoader loader) - Specified by:
- informin interface- org.apache.lucene.util.ResourceLoaderAware
 
 - 
initializeMetricspublic void initializeMetrics(SolrMetricsContext parentContext, String scope) Description copied from interface:SolrMetricProducerInitialize metrics specific to this producer.- Specified by:
- initializeMetricsin interface- SolrMetricProducer
- Overrides:
- initializeMetricsin class- AuditLoggerPlugin
- Parameters:
- parentContext- parent metrics context. If this component has the same life-cycle as the parent it can simply use the parent context, otherwise it should obtain a child context using- SolrMetricsContext.getChildContext(Object)passing- thisas the child object.
- scope- component scope
 
 - 
closepublic void close() throws IOExceptionDescription copied from class:AuditLoggerPluginWaits 30s for async queue to drain, then closes executor threads. Subclasses should either callsuper.close()orAuditLoggerPlugin.waitForQueueToDrain(int)before shutting itself down to make sure they can complete logging events in the queue.- Specified by:
- closein interface- AutoCloseable
- Specified by:
- closein interface- Closeable
- Specified by:
- closein interface- SolrMetricProducer
- Overrides:
- closein class- AuditLoggerPlugin
- Throws:
- IOException
 
 
- 
 
-