Class NoSqlAppender
- java.lang.Object
-
- org.apache.logging.log4j.core.AbstractLifeCycle
-
- org.apache.logging.log4j.core.filter.AbstractFilterable
-
- org.apache.logging.log4j.core.appender.AbstractAppender
-
- org.apache.logging.log4j.core.appender.db.AbstractDatabaseAppender<NoSqlDatabaseManager<?>>
-
- org.apache.logging.log4j.core.appender.nosql.NoSqlAppender
-
- All Implemented Interfaces:
Appender
,Filterable
,LifeCycle
,LifeCycle2
@Plugin(name="NoSql", category="Core", elementType="appender", printObject=true) public final class NoSqlAppender extends AbstractDatabaseAppender<NoSqlDatabaseManager<?>>
This Appender writes logging events to a NoSQL database using a configured NoSQL provider. It requires implementations ofNoSqlObject
,NoSqlConnection
, andNoSqlProvider
to "know" how to write events to the chosen NoSQL database. For examples on how to write your own NoSQL provider, see the simple source code for the MongoDB and CouchDB providers.- See Also:
NoSqlObject
,NoSqlConnection
,NoSqlProvider
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.apache.logging.log4j.core.appender.AbstractAppender
AbstractAppender.Builder<B extends AbstractAppender.Builder<B>>
-
Nested classes/interfaces inherited from interface org.apache.logging.log4j.core.LifeCycle
LifeCycle.State
-
-
Field Summary
-
Fields inherited from class org.apache.logging.log4j.core.AbstractLifeCycle
DEFAULT_STOP_TIMEOUT, DEFAULT_STOP_TIMEUNIT, LOGGER
-
Fields inherited from interface org.apache.logging.log4j.core.Appender
ELEMENT_TYPE
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static NoSqlAppender
createAppender(java.lang.String name, java.lang.String ignore, Filter filter, java.lang.String bufferSize, NoSqlProvider<?> provider)
Factory method for creating a NoSQL appender within the plugin manager.java.lang.String
toString()
-
Methods inherited from class org.apache.logging.log4j.core.appender.db.AbstractDatabaseAppender
append, getLayout, getManager, replaceManager, start, stop
-
Methods inherited from class org.apache.logging.log4j.core.appender.AbstractAppender
error, error, error, getHandler, getName, ignoreExceptions, parseInt, setHandler
-
Methods inherited from class org.apache.logging.log4j.core.filter.AbstractFilterable
addFilter, getFilter, hasFilter, isFiltered, removeFilter, stop
-
Methods inherited from class org.apache.logging.log4j.core.AbstractLifeCycle
equalsImpl, getState, getStatusLogger, hashCodeImpl, initialize, isInitialized, isStarted, isStarting, isStopped, isStopping, setStarted, setStarting, setState, setStopped, setStopping, stop, stop
-
-
-
-
Method Detail
-
toString
public java.lang.String toString()
- Overrides:
toString
in classAbstractAppender
-
createAppender
@PluginFactory public static NoSqlAppender createAppender(@PluginAttribute("name") java.lang.String name, @PluginAttribute("ignoreExceptions") java.lang.String ignore, @PluginElement("Filter") Filter filter, @PluginAttribute("bufferSize") java.lang.String bufferSize, @PluginElement("NoSqlProvider") NoSqlProvider<?> provider)
Factory method for creating a NoSQL appender within the plugin manager.- Parameters:
name
- The name of the appender.ignore
- If"true"
(default) exceptions encountered when appending events are logged; otherwise they are propagated to the caller.filter
- The filter, if any, to use.bufferSize
- If an integer greater than 0, this causes the appender to buffer log events and flush whenever the buffer reaches this size.provider
- The NoSQL provider that provides connections to the chosen NoSQL database.- Returns:
- a new NoSQL appender.
-
-