|
Log4j 2.0alpha-1 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.log4j.spi.ComponentBase
org.apache.log4j.plugins.PluginSkeleton
org.apache.log4j.plugins.Receiver
org.apache.log4j.xml.LogFileXMLReceiver
public class LogFileXMLReceiver
LogFileXMLReceiver will read an xml-formated log file and make the events in the log file available to the log4j framework.
This receiver supports log files created using log4j's XMLLayout, as well as java.util.logging XMLFormatter (via the org.apache.log4j.spi.Decoder interface).
By default, log4j's XMLLayout is supported (no need to specify a decoder in that case).
To configure this receiver to support java.util.logging's XMLFormatter, specify a 'decoder' param of org.apache.log4j.xml.UtilLoggingXMLDecoder.
Tailing -may- work, but not in all cases (try using a file:// URL). If a process has a log file open, the receiver may be able to read and tail the file. If the process closes the file and reopens the file, the receiver may not be able to continue tailing the file.
An expressionFilter may be specified. Only events passing the expression will be forwarded to the log4j framework.
Once the event has been "posted", it will be handled by the appenders currently configured in the LoggerRespository.
Field Summary |
---|
Fields inherited from class org.apache.log4j.plugins.Receiver |
---|
thresholdLevel |
Fields inherited from class org.apache.log4j.plugins.PluginSkeleton |
---|
active, name |
Fields inherited from class org.apache.log4j.spi.ComponentBase |
---|
repository |
Constructor Summary | |
---|---|
LogFileXMLReceiver()
|
Method Summary | |
---|---|
void |
activateOptions()
Process the file |
java.lang.String |
getDecoder()
Accessor |
java.lang.String |
getFileURL()
Accessor |
java.lang.String |
getFilterExpression()
Accessor |
boolean |
isTailing()
Accessor |
static void |
main(java.lang.String[] args)
|
void |
setDecoder(java.lang.String _decoder)
Specify the class name implementing org.apache.log4j.spi.Decoder that can process the file. |
void |
setFileURL(java.lang.String fileURL)
Specify the URL of the XML-formatted file to process. |
void |
setFilterExpression(java.lang.String filterExpression)
Set the filter expression that will cause only events which pass the filter to be forwarded to the log4j framework. |
void |
setTailing(boolean tailing)
Set the 'tailing' flag - may only work on file:// URLs and may stop tailing if the writing process closes the file and reopens. |
void |
shutdown()
Close the receiver, release any resources that are accessing the file. |
Methods inherited from class org.apache.log4j.plugins.Receiver |
---|
doPost, getThreshold, isAsSevereAsThreshold, setThreshold |
Methods inherited from class org.apache.log4j.plugins.PluginSkeleton |
---|
addPropertyChangeListener, addPropertyChangeListener, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getLoggerRepository, getName, isActive, isEquivalent, removePropertyChangeListener, removePropertyChangeListener, setLoggerRepository, setName |
Methods inherited from class org.apache.log4j.spi.ComponentBase |
---|
getLogger, getNonFloodingLogger, resetErrorCount |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public LogFileXMLReceiver()
Method Detail |
---|
public java.lang.String getFileURL()
public void setFileURL(java.lang.String fileURL)
fileURL
- public java.lang.String getDecoder()
public void setDecoder(java.lang.String _decoder)
_decoder
- public java.lang.String getFilterExpression()
public boolean isTailing()
public void setTailing(boolean tailing)
tailing
- public void setFilterExpression(java.lang.String filterExpression)
filterExpression
- public static void main(java.lang.String[] args)
public void shutdown()
public void activateOptions()
|
Log4j 2.0alpha-1 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |