Package org.jboss.logmanager.handlers
Class ConsoleHandler
java.lang.Object
java.util.logging.Handler
org.jboss.logmanager.ExtHandler
org.jboss.logmanager.handlers.WriterHandler
org.jboss.logmanager.handlers.OutputStreamHandler
org.jboss.logmanager.handlers.ConsoleHandler
- All Implemented Interfaces:
Closeable,Flushable,AutoCloseable,FlushableCloseable
A console handler which writes to
System.out by default.-
Nested Class Summary
Nested Classes -
Field Summary
Fields inherited from class org.jboss.logmanager.handlers.WriterHandler
outputLockFields inherited from class org.jboss.logmanager.ExtHandler
handlers, handlersUpdater -
Constructor Summary
ConstructorsConstructorDescriptionConstruct a new instance.ConsoleHandler(Formatter formatter) Construct a new instance.ConsoleHandler(ConsoleHandler.Target target) Construct a new instance.ConsoleHandler(ConsoleHandler.Target target, Formatter formatter) Construct a new instance. -
Method Summary
Modifier and TypeMethodDescriptionGet the local error manager.voidvoidsetOutputStream(OutputStream outputStream) Set the output stream to write to.voidsetTarget(ConsoleHandler.Target target) Set the target for this console handler.Methods inherited from class org.jboss.logmanager.handlers.OutputStreamHandler
getEncoding, setEncoding, setWriterMethods inherited from class org.jboss.logmanager.handlers.WriterHandler
close, doPublish, flush, preWrite, safeCloseMethods inherited from class org.jboss.logmanager.ExtHandler
addHandler, clearHandlers, getHandlers, isAutoFlush, isCallerCalculationRequired, isCloseChildren, isEnabled, publish, publish, publishToNestedHandlers, removeHandler, reportError, reportError, setAutoFlush, setCloseChildren, setEnabled, setFilter, setFormatter, setHandlers, setLevelMethods inherited from class java.util.logging.Handler
getErrorManager, getFilter, getFormatter, getLevel, isLoggable
-
Constructor Details
-
ConsoleHandler
public ConsoleHandler()Construct a new instance. -
ConsoleHandler
Construct a new instance.- Parameters:
formatter- the formatter to use
-
ConsoleHandler
Construct a new instance.- Parameters:
target- the target to write to, ornullto start with an uninitialized target
-
ConsoleHandler
Construct a new instance.- Parameters:
target- the target to write to, ornullto start with an uninitialized targetformatter- the formatter to use
-
-
Method Details
-
setTarget
Set the target for this console handler.- Parameters:
target- the target to write to, ornullto clear the target
-
setErrorManager
- Overrides:
setErrorManagerin classExtHandler
-
getLocalErrorManager
Get the local error manager. This is an error manager that will publish errors to this console handler. The console handler itself should not use this error manager.- Returns:
- the local error manager
-
setOutputStream
Set the output stream to write to. The output stream will then belong to this handler; when the handler is closed or a new writer or output stream is set, this output stream will be closed.- Overrides:
setOutputStreamin classOutputStreamHandler- Parameters:
outputStream- the new output stream ornullfor none
-