org.apache.log4j.xml
クラス LogFileXMLReceiver

java.lang.Object
  上位を拡張 org.apache.log4j.spi.ComponentBase
      上位を拡張 org.apache.log4j.plugins.PluginSkeleton
          上位を拡張 org.apache.log4j.plugins.Receiver
              上位を拡張 org.apache.log4j.xml.LogFileXMLReceiver
すべての実装されたインタフェース:
org.apache.log4j.plugins.Plugin, org.apache.log4j.spi.Component, org.apache.log4j.spi.OptionHandler, org.apache.log4j.spi.Thresholdable

public class LogFileXMLReceiver
extends org.apache.log4j.plugins.Receiver

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.

導入されたバージョン:
1.3
作成者:
Scott Deboy

フィールドの概要
 
クラス org.apache.log4j.plugins.Receiver から継承されたフィールド
thresholdLevel
 
クラス org.apache.log4j.plugins.PluginSkeleton から継承されたフィールド
active, name
 
クラス org.apache.log4j.spi.ComponentBase から継承されたフィールド
repository
 
コンストラクタの概要
LogFileXMLReceiver()
           
 
メソッドの概要
 void activateOptions()
          Process the file
 java.lang.String getDecoder()
          Accessor
 java.lang.String getFileURL()
          Accessor
 java.lang.String getFilterExpression()
          Accessor
 boolean isTailing()
          Accessor
 boolean isUseCurrentThread()
          When true, this property uses the current Thread to perform the import, otherwise when false (the default), a new Thread is created and started to manage the import.
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 setUseCurrentThread(boolean useCurrentThread)
          Sets whether the current Thread or a new Thread is created to perform the import, the default being false (new Thread created).
 void shutdown()
          Close the receiver, release any resources that are accessing the file.
 
クラス org.apache.log4j.plugins.Receiver から継承されたメソッド
doPost, getThreshold, isAsSevereAsThreshold, setThreshold
 
クラス org.apache.log4j.plugins.PluginSkeleton から継承されたメソッド
addPropertyChangeListener, addPropertyChangeListener, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getLoggerRepository, getName, isActive, isEquivalent, removePropertyChangeListener, removePropertyChangeListener, setLoggerRepository, setName
 
クラス org.apache.log4j.spi.ComponentBase から継承されたメソッド
getLogger, getNonFloodingLogger, resetErrorCount
 
クラス java.lang.Object から継承されたメソッド
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

コンストラクタの詳細

LogFileXMLReceiver

public LogFileXMLReceiver()
メソッドの詳細

getFileURL

public java.lang.String getFileURL()
Accessor

戻り値:
file URL

setFileURL

public void setFileURL(java.lang.String fileURL)
Specify the URL of the XML-formatted file to process.

パラメータ:
fileURL -

getDecoder

public java.lang.String getDecoder()
Accessor

戻り値:

setDecoder

public void setDecoder(java.lang.String _decoder)
Specify the class name implementing org.apache.log4j.spi.Decoder that can process the file.

パラメータ:
_decoder -

getFilterExpression

public java.lang.String getFilterExpression()
Accessor

戻り値:
filter expression

isTailing

public boolean isTailing()
Accessor

戻り値:
tailing flag

setTailing

public 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.

パラメータ:
tailing -

setFilterExpression

public 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.

パラメータ:
filterExpression -

main

public static void main(java.lang.String[] args)

shutdown

public void shutdown()
Close the receiver, release any resources that are accessing the file.


activateOptions

public void activateOptions()
Process the file


isUseCurrentThread

public final boolean isUseCurrentThread()
When true, this property uses the current Thread to perform the import, otherwise when false (the default), a new Thread is created and started to manage the import.

戻り値:

setUseCurrentThread

public final void setUseCurrentThread(boolean useCurrentThread)
Sets whether the current Thread or a new Thread is created to perform the import, the default being false (new Thread created).

パラメータ:
useCurrentThread -


Copyright © 2010 Apache Software Foundation. All Rights Reserved.