org.apache.log4j.net

Class TelnetAppender

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

Author: Jay Funnell

Nested Class Summary
protected classTelnetAppender.SocketHandler
The SocketHandler class is used to accept connections from clients.
Method Summary
voidactivateOptions()
all of the options have been set, create the socket handler and wait for connections.
protected voidappend(LoggingEvent event)
Handles a log event.
voidclose()
shuts down the appender.
intgetPort()
booleanrequiresLayout()
This appender requires a layout to format the text to the attached client(s).
voidsetPort(int port)

Method Detail

activateOptions

public void activateOptions()
all of the options have been set, create the socket handler and wait for connections.

append

protected void append(LoggingEvent event)
Handles a log event. For this appender, that means writing the message to each connected client.

close

public void close()
shuts down the appender.

getPort

public int getPort()

requiresLayout

public boolean requiresLayout()
This appender requires a layout to format the text to the attached client(s).

setPort

public void setPort(int port)
Copyright 2000-2005 Apache Software Foundation.