@Plugin(name="MetricsAppender",
category="Core",
elementType="appender")
public class InstrumentedAppender
extends org.apache.logging.log4j.core.appender.AbstractAppender
Appender which has seven meters, one for each logging level and one for the total
number of statements being logged. The meter names are the logging level names appended to the
name of the appender.| Constructor and Description |
|---|
InstrumentedAppender(io.dropwizard.metrics5.MetricRegistry registry)
Create a new instrumented appender using the given registry.
|
InstrumentedAppender(io.dropwizard.metrics5.MetricRegistry registry,
org.apache.logging.log4j.core.Filter filter,
org.apache.logging.log4j.core.Layout<? extends Serializable> layout,
boolean ignoreExceptions)
Create a new instrumented appender using the given registry.
|
InstrumentedAppender(String registryName)
Create a new instrumented appender using the given registry name.
|
InstrumentedAppender(String registryName,
org.apache.logging.log4j.core.Filter filter,
org.apache.logging.log4j.core.Layout<? extends Serializable> layout,
boolean ignoreExceptions)
Create a new instrumented appender using the given registry name.
|
InstrumentedAppender(String appenderName,
io.dropwizard.metrics5.MetricRegistry registry)
Create a new instrumented appender using the given appender name and registry.
|
| Modifier and Type | Method and Description |
|---|---|
void |
append(org.apache.logging.log4j.core.LogEvent event) |
static InstrumentedAppender |
createAppender(String name,
String registry) |
void |
start() |
error, error, error, getHandler, getLayout, getName, ignoreExceptions, parseInt, requiresLocation, setHandler, toSerializable, toStringaddFilter, getFilter, getPropertyArray, hasFilter, isFiltered, removeFilter, stop, stopequalsImpl, getState, getStatusLogger, hashCodeImpl, initialize, isInitialized, isStarted, isStarting, isStopped, isStopping, setStarted, setStarting, setState, setStopped, setStopping, stop, stoppublic InstrumentedAppender(String registryName, org.apache.logging.log4j.core.Filter filter, org.apache.logging.log4j.core.Layout<? extends Serializable> layout, boolean ignoreExceptions)
registryName - the name of the registry in SharedMetricRegistriesfilter - The Filter to associate with the Appender.layout - The layout to use to format the event.ignoreExceptions - If true, exceptions will be logged and suppressed. If false errors will be
logged and then passed to the application.public InstrumentedAppender(String registryName)
registryName - the name of the registry in SharedMetricRegistriespublic InstrumentedAppender(io.dropwizard.metrics5.MetricRegistry registry)
registry - the metric registrypublic InstrumentedAppender(io.dropwizard.metrics5.MetricRegistry registry,
org.apache.logging.log4j.core.Filter filter,
org.apache.logging.log4j.core.Layout<? extends Serializable> layout,
boolean ignoreExceptions)
registry - the metric registryfilter - The Filter to associate with the Appender.layout - The layout to use to format the event.ignoreExceptions - If true, exceptions will be logged and suppressed. If false errors will be
logged and then passed to the application.public InstrumentedAppender(String appenderName, io.dropwizard.metrics5.MetricRegistry registry)
appenderName - The name of the appender.registry - the metric registry@PluginFactory public static InstrumentedAppender createAppender(@PluginAttribute(value="name") String name, @PluginAttribute(value="registryName",defaultString="log4j2Metrics") String registry)
public void start()
start in interface org.apache.logging.log4j.core.LifeCyclestart in class org.apache.logging.log4j.core.filter.AbstractFilterablepublic void append(org.apache.logging.log4j.core.LogEvent event)
Copyright © 2019. All rights reserved.