public class PaxAppenderDelegate
extends ch.qos.logback.core.UnsynchronizedAppenderBase<ch.qos.logback.classic.spi.ILoggingEvent>
This is a Logback appender that forwards log messages to any services registered with OSGi with the interface org.ops4j.pax.logging.spi.PaxAppender. That list of appender services is possibly filtered by the paxname setting.
For example, you can use it like this in your logback.xml file:
<appender name="OSGI" class="org.ops4j.pax.logging.logback.appender.PaxAppenderDelegate">
<paxname>*</paxname>
</appender>
The paxname argument is a filter for the bundle property "org.ops4j.pax.logging.appender.name". In this example,
the "*" means to accept all delegatees.
This class is inspired by PaxLoggingConfigurator.parseAppender(), PaxAppenderProxy and AppenderBridgeImpl in the log4j implementation.
| Constructor and Description |
|---|
PaxAppenderDelegate() |
| Modifier and Type | Method and Description |
|---|---|
protected void |
append(ch.qos.logback.classic.spi.ILoggingEvent event) |
void |
setPaxname(String paxname)
Allows filtering on OSGi services on the bundle property "org.ops4j.pax.logging.appender.name"
|
void |
start() |
void |
stop() |
addFilter, clearAllFilters, doAppend, getCopyOfAttachedFiltersList, getFilterChainDecision, getName, isStarted, setName, toStringaddError, addError, addInfo, addInfo, addStatus, addWarn, addWarn, getContext, getDeclaredOrigin, getStatusManager, setContextpublic void setPaxname(String paxname)
paxname - defaults to "*", can be any string that works as a value in Filter.public void start()
start in interface ch.qos.logback.core.spi.LifeCyclestart in class ch.qos.logback.core.UnsynchronizedAppenderBase<ch.qos.logback.classic.spi.ILoggingEvent>public void stop()
stop in interface ch.qos.logback.core.spi.LifeCyclestop in class ch.qos.logback.core.UnsynchronizedAppenderBase<ch.qos.logback.classic.spi.ILoggingEvent>protected void append(ch.qos.logback.classic.spi.ILoggingEvent event)
append in class ch.qos.logback.core.UnsynchronizedAppenderBase<ch.qos.logback.classic.spi.ILoggingEvent>Copyright © 2006–2021 OPS4J - Open Participation Software for Java. All rights reserved.