public class TelnetAppender extends AppenderSkeleton
The TelnetAppender is a log4j appender that specializes in writing to a read-only socket. The output is provided in a telnet-friendly way so that a log can be monitored over TCP/IP. Clients using telnet connect to the socket and receive log data. This is handy for remote monitoring, especially when monitoring a servlet.
Here is a list of the available configuration options:
Name | Requirement | Description | Sample Value |
---|---|---|---|
Port | optional | This parameter determines the port to use for announcing log events. The default port is 23 (telnet). | 5875 |
限定符和类型 | 类和说明 |
---|---|
protected class |
TelnetAppender.SocketHandler
The SocketHandler class is used to accept connections from
clients.
|
closed, errorHandler, headFilter, layout, name, tailFilter, threshold
构造器和说明 |
---|
TelnetAppender() |
限定符和类型 | 方法和说明 |
---|---|
void |
activateOptions()
all of the options have been set, create the socket handler and
wait for connections.
|
protected void |
append(LoggingEvent event)
Handles a log event.
|
void |
close()
shuts down the appender.
|
int |
getPort() |
boolean |
requiresLayout()
This appender requires a layout to format the text to the
attached client(s).
|
void |
setPort(int port) |
addFilter, clearFilters, doAppend, finalize, getErrorHandler, getFilter, getFirstFilter, getLayout, getName, getThreshold, isAsSevereAsThreshold, setErrorHandler, setLayout, setName, setThreshold
public boolean requiresLayout()
public void activateOptions()
activateOptions
在接口中 OptionHandler
activateOptions
在类中 AppenderSkeleton
public int getPort()
public void setPort(int port)
public void close()
protected void append(LoggingEvent event)
append
在类中 AppenderSkeleton