|
Log4j 1.3alpha-7 | ||||||||||
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.AppenderSkeleton
org.apache.log4j.net.MulticastAppender
Multicast-based Appender. Works in conjunction with the MulticastReceiver, which expects a LoggingEvent encoded using XMLLayout. Sends log information as a multicast datagrams.
Messages are not sent as LoggingEvent objects but as text after applying XMLLayout.
The port and remoteHost properties can be set in configuration properties. By setting the remoteHost to a broadcast address any number of clients can listen for log messages.
This was inspired and really extended/copied from SocketAppender
. Please
see the docs for the proper credit to the authors of that class.
Field Summary |
Fields inherited from class org.apache.log4j.AppenderSkeleton |
active, closed, headFilter, layout, name, tailFilter, threshold |
Fields inherited from class org.apache.log4j.spi.ComponentBase |
repository |
Constructor Summary | |
MulticastAppender()
|
Method Summary | |
void |
activateOptions()
Open the multicast sender for the RemoteHost and Port. |
void |
append(LoggingEvent event)
Subclasses of AppenderSkeleton should implement this method
to perform actual logging. |
void |
cleanUp()
Close the Socket and release the underlying connector thread if it has been created |
void |
close()
Close this appender. |
String |
getApplication()
Returns value of the App option. |
String |
getEncoding()
Returns value of the Encoding option. |
String |
getOverrideProperties()
Returns value of the OverrideProperties option. |
int |
getPort()
Returns value of the Port option. |
String |
getRemoteHost()
Returns value of the RemoteHost option. |
int |
getTimeToLive()
Returns value of the Time to Live option. |
boolean |
isActive()
Returns true if this appender is working order. |
void |
setApplication(String app)
The App option takes a string value which should be the name of the application getting logged. |
void |
setEncoding(String encoding)
The Encoding option specifies how the bytes are encoded. |
void |
setOverrideProperties(String overrideProperties)
The OverrideProperties option allows configurations where the appender does not apply the machinename/appname properties - the properties will be used as provided. |
void |
setPort(int port)
The Port option takes a positive integer representing the port where multicast packets will be sent. |
void |
setRemoteHost(String host)
The RemoteHost option takes a string value which should be the host name or ipaddress to send the multicast packets. |
void |
setTimeToLive(int timeToLive)
The Time to live option takes a positive integer representing the time to live value. |
Methods inherited from class org.apache.log4j.AppenderSkeleton |
addFilter, clearFilters, doAppend, finalize, getErrorHandler, getFilter, getFirstFilter, getLayout, getName, getThreshold, isAsSevereAsThreshold, isClosed, setErrorHandler, setLayout, setName, setThreshold |
Methods inherited from class org.apache.log4j.spi.ComponentBase |
getLogger, getLoggerRepository, getNonFloodingLogger, resetErrorCount, setLoggerRepository |
Methods inherited from class java.lang.Object |
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface org.apache.log4j.net.NetworkBased |
getName |
Methods inherited from interface org.apache.log4j.Appender |
setLoggerRepository |
Constructor Detail |
public MulticastAppender()
Method Detail |
public void activateOptions()
activateOptions
in interface OptionHandler
activateOptions
in class AppenderSkeleton
public void close()
This will mark the appender as closed and
call then cleanUp()
method.
close
in interface Appender
public void cleanUp()
public void append(LoggingEvent event)
AppenderSkeleton
AppenderSkeleton
should implement this method
to perform actual logging. See also AppenderSkeleton.doAppend
method.
append
in class AppenderSkeleton
public void setRemoteHost(String host)
public String getRemoteHost()
public void setEncoding(String encoding)
public String getEncoding()
public void setApplication(String app)
public String getApplication()
public void setOverrideProperties(String overrideProperties)
public String getOverrideProperties()
public void setTimeToLive(int timeToLive)
public int getTimeToLive()
public void setPort(int port)
public int getPort()
getPort
in interface PortBased
public boolean isActive()
AppenderSkeleton
isActive
in interface NetworkBased
isActive
in class AppenderSkeleton
|
Log4j 1.3alpha-7 | ||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |