public class DynamicStreamHandler extends StreamHandler
StreamHandler delegate that allows for the swap and disable of
another handler. When setHandler(StreamHandler) is called with
null, then records passed onto this handler will be dropped. Otherwise,
the delegate handler will receive those records.| Constructor and Description |
|---|
DynamicStreamHandler() |
| Modifier and Type | Method and Description |
|---|---|
void |
close() |
void |
flush() |
String |
getEncoding() |
Filter |
getFilter() |
Formatter |
getFormatter() |
StreamHandler |
getHandler()
Get the delegate handler.
|
Level |
getLevel() |
boolean |
isLoggable(LogRecord record) |
void |
publish(LogRecord record) |
void |
setEncoding(String encoding) |
void |
setFilter(Filter newFilter) |
void |
setFormatter(Formatter newFormatter) |
void |
setHandler(StreamHandler handler)
Set the handler.
|
void |
setLevel(Level newLevel) |
setOutputStreamgetErrorManager, reportError, setErrorManager@Nullable public StreamHandler getHandler()
public void setHandler(@Nullable StreamHandler handler)
handler - the delegate handler (which can be null)public void publish(LogRecord record)
publish in class StreamHandlerpublic void close()
throws SecurityException
close in class StreamHandlerSecurityExceptionpublic void setEncoding(@Nullable String encoding) throws SecurityException, UnsupportedEncodingException
setEncoding in class StreamHandlerSecurityExceptionUnsupportedEncodingExceptionpublic boolean isLoggable(LogRecord record)
isLoggable in class StreamHandlerpublic void flush()
flush in class StreamHandlerpublic void setFormatter(@Nullable Formatter newFormatter) throws SecurityException
setFormatter in class HandlerSecurityExceptionpublic Formatter getFormatter()
getFormatter in class Handlerpublic String getEncoding()
getEncoding in class Handlerpublic void setFilter(@Nullable Filter newFilter) throws SecurityException
setFilter in class HandlerSecurityExceptionpublic void setLevel(Level newLevel) throws SecurityException
setLevel in class HandlerSecurityExceptionCopyright © 2010-2014. All Rights Reserved.