java.lang.Object | |||
↳ | java.util.logging.Handler | ||
↳ | java.util.logging.StreamHandler | ||
↳ | java.util.logging.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.
Public Constructors | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
|
Constructs a
SocketHandler
object using the properties read by
the log manager, including the host name and port number.
|
||||||||||
|
Constructs a
SocketHandler
object using the specified host name
and port number together with other properties read by the log manager.
|
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
|
Closes this handler.
|
||||||||||
|
Logs a record if necessary.
|
[Expand]
Inherited Methods
|
|||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
From class
java.util.logging.StreamHandler
|
|||||||||||
From class
java.util.logging.Handler
|
|||||||||||
From class
java.lang.Object
|
Constructs a
SocketHandler
object using the properties read by
the log manager, including the host name and port number. Default
formatting uses the XMLFormatter class and level is set to ALL.
IOException | if failed to connect to the specified host and port. |
---|---|
IllegalArgumentException | if the host name or port number is illegal. |
Constructs a
SocketHandler
object using the specified host name
and port number together with other properties read by the log manager.
Default formatting uses the XMLFormatter class and level is set to ALL.
host | the host name |
---|---|
port | the port number |
IOException | if failed to connect to the specified host and port. |
---|---|
IllegalArgumentException | if the host name or port number is illegal. |
Closes this handler. The network connection to the host is also closed.
Logs a record if necessary. A flush operation will be done afterwards.
record | the log record to be logged. |
---|