|
Build 1.0_r1(from source) | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjava.util.logging.Handler
java.util.logging.StreamHandler
java.util.logging.SocketHandler
public class SocketHandler
A handler that writes log messages to a socket connection.
This handler reads the following properties from the log manager to initialize itself:
Level.ALL if this property is not found or has an
invalid value;
null if
this property is not found or has an invalid value;
java.util.logging.XMLFormatter if this property is not found
or has an invalid value;
null if
this property is not found or has an invalid value.
This handler buffers the outgoing messages, but flushes each time a log record has been published.
This class is not thread-safe.
| Constructor Summary | |
|---|---|
SocketHandler()
Constructs a SocketHandler object using the properties
read by the log manager, including the host name and port number. |
|
SocketHandler(String host,
int port)
Constructs a SocketHandler object using the specified host
name and port number together with other properties read by the log
manager. |
|
| Method Summary | |
|---|---|
void |
close()
Closes this handler. |
void |
publish(LogRecord record)
Logs a record if necessary. |
| Methods inherited from class java.util.logging.StreamHandler |
|---|
close, flush, internalSetOutputStream, isLoggable, setEncoding, setOutputStream |
| Methods inherited from class java.util.logging.Handler |
|---|
getEncoding, getErrorManager, getFilter, getFormatter, getLevel, initProperties, internalSetEncoding, internalSetFormatter, printInvalidPropMessage, reportError, setErrorManager, setFilter, setFormatter, setLevel |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public SocketHandler()
throws IOException
SocketHandler object using the properties
read by the log manager, including the host name and port number.
IOException - If failed to connect to the specified host and port.
IllegalArgumentException - If the host name or port number is illegal.
SecurityException - If a security manager determines that the caller does not
have the required permission to control this handler.
public SocketHandler(String host,
int port)
throws IOException
SocketHandler object using the specified host
name and port number together with other properties read by the log
manager.
host - the host nameport - the port number
IOException - If failed to connect to the specified host and port.
IllegalArgumentException - If the host name or port number is illegal.
SecurityException - If a security manager determines that the caller does not
have the required permission to control this handler.| Method Detail |
|---|
public void close()
close in class StreamHandlerSecurityException - If a security manager determines that the caller does not
have the required permission to control this handler.public void publish(LogRecord record)
publish in class StreamHandlerrecord - the log record to be logged
|
Build 1.0_r1(from source) | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||