org.apache.log4j.net
クラス XMLSocketReceiver

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

public class XMLSocketReceiver
extends org.apache.log4j.plugins.Receiver
implements java.lang.Runnable, PortBased, org.apache.log4j.plugins.Pauseable

XMLSocketReceiver receives a remote logging event via XML on a configured socket and "posts" it to a LoggerRepository as if the event were generated locally. This class is designed to receive events from the XMLSocketAppender class (or classes that send compatible events).

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.

Once the event has been "posted", it will be handled by the appenders currently configured in the LoggerRespository.

作成者:
Mark Womack, Scott Deboy

フィールドの概要
protected  boolean active
           
protected  java.lang.String decoder
           
static int DEFAULT_PORT
           
protected  int port
           
static java.lang.String ZONE
          The MulticastDNS zone advertised by an XMLSocketReceiver
 
クラス org.apache.log4j.plugins.Receiver から継承されたフィールド
thresholdLevel
 
クラス org.apache.log4j.plugins.PluginSkeleton から継承されたフィールド
name
 
クラス org.apache.log4j.spi.ComponentBase から継承されたフィールド
repository
 
コンストラクタの概要
XMLSocketReceiver()
           
XMLSocketReceiver(int _port)
           
XMLSocketReceiver(int _port, org.apache.log4j.spi.LoggerRepository _repository)
           
 
メソッドの概要
 void activateOptions()
          Starts the SocketReceiver with the current options.
 void doPost(org.apache.log4j.spi.LoggingEvent event)
           
 java.lang.String getDecoder()
           
 int getPort()
          Get the port to receive logging events on.
 int hashCode()
           
 boolean isAdvertiseViaMulticastDNS()
           
 boolean isEquivalent(org.apache.log4j.plugins.Plugin testPlugin)
          Returns true if the receiver is the same class and they are configured for the same properties, and super class also considers them to be equivalent.
 boolean isPaused()
           
 void run()
          Loop, accepting new socket connections.
protected  void setActive(boolean b)
          Sets the flag to indicate if receiver is active or not.
 void setAdvertiseViaMulticastDNS(boolean advertiseViaMulticastDNS)
           
 void setDecoder(java.lang.String _decoder)
          Specify the class name implementing org.apache.log4j.spi.Decoder that can process the file.
 void setPaused(boolean b)
           
 void setPort(int _port)
          Set the port to receive logging events on.
 void shutdown()
          Called when the receiver should be stopped.
 
クラス org.apache.log4j.plugins.Receiver から継承されたメソッド
getThreshold, isAsSevereAsThreshold, setThreshold
 
クラス org.apache.log4j.plugins.PluginSkeleton から継承されたメソッド
addPropertyChangeListener, addPropertyChangeListener, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getLoggerRepository, getName, isActive, removePropertyChangeListener, removePropertyChangeListener, setLoggerRepository, setName
 
クラス org.apache.log4j.spi.ComponentBase から継承されたメソッド
getLogger, getNonFloodingLogger, resetErrorCount
 
クラス java.lang.Object から継承されたメソッド
clone, equals, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 
インタフェース org.apache.log4j.net.NetworkBased から継承されたメソッド
getName, isActive
 

フィールドの詳細

active

protected boolean active

decoder

protected java.lang.String decoder

DEFAULT_PORT

public static final int DEFAULT_PORT
関連項目:
定数フィールド値

port

protected int port

ZONE

public static final java.lang.String ZONE
The MulticastDNS zone advertised by an XMLSocketReceiver

関連項目:
定数フィールド値
コンストラクタの詳細

XMLSocketReceiver

public XMLSocketReceiver()

XMLSocketReceiver

public XMLSocketReceiver(int _port)

XMLSocketReceiver

public XMLSocketReceiver(int _port,
                         org.apache.log4j.spi.LoggerRepository _repository)
メソッドの詳細

getPort

public int getPort()
Get the port to receive logging events on.

定義:
インタフェース PortBased 内の getPort
戻り値:
int port number

setPort

public void setPort(int _port)
Set the port to receive logging events on.


getDecoder

public java.lang.String getDecoder()

setDecoder

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


isPaused

public boolean isPaused()
定義:
インタフェース org.apache.log4j.plugins.Pauseable 内の isPaused

setPaused

public void setPaused(boolean b)
定義:
インタフェース org.apache.log4j.plugins.Pauseable 内の setPaused

isEquivalent

public boolean isEquivalent(org.apache.log4j.plugins.Plugin testPlugin)
Returns true if the receiver is the same class and they are configured for the same properties, and super class also considers them to be equivalent. This is used by PluginRegistry when determining if the a similarly configured receiver is being started.

定義:
インタフェース org.apache.log4j.plugins.Plugin 内の isEquivalent
オーバーライド:
クラス org.apache.log4j.plugins.PluginSkeleton 内の isEquivalent
パラメータ:
testPlugin - The plugin to test equivalency against.
戻り値:
boolean True if the testPlugin is equivalent to this plugin.

hashCode

public int hashCode()
オーバーライド:
クラス java.lang.Object 内の hashCode

setActive

protected void setActive(boolean b)
Sets the flag to indicate if receiver is active or not.

パラメータ:
b - new value

activateOptions

public void activateOptions()
Starts the SocketReceiver with the current options.

定義:
インタフェース org.apache.log4j.spi.OptionHandler 内の activateOptions

setAdvertiseViaMulticastDNS

public void setAdvertiseViaMulticastDNS(boolean advertiseViaMulticastDNS)

isAdvertiseViaMulticastDNS

public boolean isAdvertiseViaMulticastDNS()

shutdown

public void shutdown()
Called when the receiver should be stopped. Closes the server socket and all of the open sockets.

定義:
インタフェース org.apache.log4j.plugins.Plugin 内の shutdown

run

public void run()
Loop, accepting new socket connections.

定義:
インタフェース java.lang.Runnable 内の run

doPost

public void doPost(org.apache.log4j.spi.LoggingEvent event)
オーバーライド:
クラス org.apache.log4j.plugins.Receiver 内の doPost


Copyright © 2010 Apache Software Foundation. All Rights Reserved.