Java in a Nutshell, 5th Edition [Electronic resources]

نسخه متنی -صفحه : 1191/ 861
نمايش فراداده

StreamHandlerjava.util.logging

Java 1.4

This Handler subclass sends log messages to an arbitrary java.io.OutputStream. It exists primarily to serve as the common superclass of ConsoleHandler, FileHandler, and SocketHandler.

Figure 16-122. java.util.logging.StreamHandler

public class

StreamHandler extends Handler { // Public Constructors public

StreamHandler ( ); public

StreamHandler (java.io.OutputStream

out , java.util.logging.Formatter

formatter ); // Public Methods Overriding Handler public void

close ( ) throws SecurityException; synchronized public void

flush ( ); synchronized public boolean

isLoggable (LogRecord

record ); public void

publish (LogRecord

record ); synchronized public void

setEncoding (String

encoding ) throws SecurityException, java.io.UnsupportedEncodingException; // Protected Instance Methods protected void

setOutputStream (java.io.OutputStream

out ) throws SecurityException; synchronized }

Subclasses

ConsoleHandler, FileHandler, SocketHandler