public class MultiDestinationAuditLogger extends AuditLoggerPlugin implements ResourceLoaderAware
"class" : "solr.MultiDestinationAuditLogger", "plugins" : [ { "class" : "solr.SolrLogAuditLoggerPlugin" }, { "class" : "solr.MyOtherAuditPlugin"} ]This interface may change in next release and is marked experimental
AuditLoggerPlugin.AuditEventFormatter, AuditLoggerPlugin.JSONAuditEventFormatter, AuditLoggerPlugin.MuteRule
SolrInfoBean.Category, SolrInfoBean.Group
eventTypes, formatter, metricManager, numErrors, numLogged, numLost, queuedTime, registryName, requestTimes, totalTime
Constructor and Description |
---|
MultiDestinationAuditLogger() |
Modifier and Type | Method and Description |
---|---|
void |
audit(AuditEvent event)
Passes the AuditEvent to all sub plugins in parallel.
|
void |
close()
Waits 30s for async queue to drain, then closes executor threads.
|
void |
inform(ResourceLoader loader) |
void |
init(Map<String,Object> pluginConfig)
Initialize the plugin from security.json
|
void |
initializeMetrics(SolrMetricManager manager,
String registryName,
String tag,
String scope)
Initializes metrics specific to this producer
|
boolean |
shouldLog(AuditEvent.EventType eventType)
Checks whether this event type should be logged based on "eventTypes" config parameter.
|
auditAsync, doAudit, getCategory, getDescription, getMetricNames, getMetricRegistry, getName, run, setFormatter, shouldMute, waitForQueueToDrain
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getMetricsSnapshot, registerMetricName
public void audit(AuditEvent event)
AuditEvent
to be able to pull context info.audit
in class AuditLoggerPlugin
event
- the audit eventpublic void init(Map<String,Object> pluginConfig)
init
in class AuditLoggerPlugin
pluginConfig
- the config for the pluginpublic boolean shouldLog(AuditEvent.EventType eventType)
AuditLoggerPlugin
shouldLog
in class AuditLoggerPlugin
eventType
- the event type to considerpublic void inform(ResourceLoader loader)
inform
in interface ResourceLoaderAware
public void initializeMetrics(SolrMetricManager manager, String registryName, String tag, String scope)
SolrMetricProducer
initializeMetrics
in interface SolrMetricProducer
initializeMetrics
in class AuditLoggerPlugin
manager
- an instance of SolrMetricManager
registryName
- registry name where metrics are registeredtag
- 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 and is set when
SolrMetricProducer.initializeMetrics(SolrMetricManager, String, String, String)
is called.scope
- scope of the metrics (eg. handler name) to separate metrics ofpublic void close() throws IOException
AuditLoggerPlugin
super.close()
or AuditLoggerPlugin.waitForQueueToDrain(int)
before shutting itself down to make sure they can complete logging events in the queue.close
in interface Closeable
close
in interface AutoCloseable
close
in class AuditLoggerPlugin
IOException
Copyright © 2000-2019 Apache Software Foundation. All Rights Reserved.