This Handler subclass formats LogRecord objects and outputs the resulting strings to a network socket. When you create a SocketHandler , you can pass the hostname and port of the socket to the constructor or you can rely on system-wide defaults obtained with LogManager.getProperty( ) . SocketHandler also uses LogManager.getProperty( ) to obtain initial values for the properties inherited from Handler . The table below lists these properties, as well as the host and port arguments, the value passed to getProperty( ) , and the default value used if getProperty( ) returns null . See Handler for further details.
Figure 16-121. java.util.logging.SocketHandlerpublic class SocketHandler extends StreamHandler { // Public Constructors public SocketHandler ( ) throws java.io.IOException; public SocketHandler (String host , int port ) throws java.io.IOException; // Public Methods Overriding StreamHandler public void close ( ) throws SecurityException; synchronized public void publish (LogRecord record ); synchronized } |