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:
  `java.io.Closeable`, `java.io.Flushable`, `java.lang.AutoCloseable`, `FlushableCloseable`, `Protectable`

    public class ConsoleHandler
    extends OutputStreamHandler

A console handler which writes to `System.out` by default.

### Nested Class Summary

Nested Classes
`static class` `ConsoleHandler.Target` The target stream type.

### Field Summary

### Fields inherited from class org.jboss.logmanager.handlers.WriterHandler

`outputLock`

### Fields inherited from class org.jboss.logmanager.ExtHandler

`handlers, handlersUpdater`

### Constructor Summary

Constructors
`ConsoleHandler()` Construct a new instance.
`ConsoleHandler​(java.util.logging.Formatter formatter)` Construct a new instance.
`ConsoleHandler​(ConsoleHandler.Target target)` Construct a new instance.
`ConsoleHandler​(ConsoleHandler.Target target, java.util.logging.Formatter formatter)` Construct a new instance.

### Method Summary

All Methods Instance Methods Concrete Methods
`void` `setOutputStream​(java.io.OutputStream outputStream)` Set the output stream to write to.
`void` `setTarget​(ConsoleHandler.Target target)` Set the target for this console handler.

### Methods inherited from class org.jboss.logmanager.handlers.OutputStreamHandler

`getEncoding, setEncoding, setWriter`

### Methods inherited from class org.jboss.logmanager.handlers.WriterHandler

`close, doPublish, flush, preWrite, safeClose`

### Methods inherited from class org.jboss.logmanager.ExtHandler

`addHandler, checkAccess, checkAccess, clearHandlers, disableAccess, enableAccess, getHandlers, isAutoFlush, isCallerCalculationRequired, isCloseChildren, isEnabled, protect, publish, publish, removeHandler, setAutoFlush, setCloseChildren, setEnabled, setErrorManager, setFilter, setFormatter, setHandlers, setLevel, unprotect`

### Methods inherited from class java.util.logging.Handler

`getErrorManager, getFilter, getFormatter, getLevel, isLoggable, reportError`

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

### Constructor Detail

#### ConsoleHandler

    public ConsoleHandler()

Construct a new instance.

#### ConsoleHandler

    public ConsoleHandler​(java.util.logging.Formatter formatter)

Construct a new instance.

Parameters:
  `formatter` - the formatter to use

#### ConsoleHandler

    public ConsoleHandler​(ConsoleHandler.Target target)

Construct a new instance.

Parameters:
  `target` - the target to write to, or `null` to start with an uninitialized target

#### ConsoleHandler

    public ConsoleHandler​(ConsoleHandler.Target target,
                          java.util.logging.Formatter formatter)

Construct a new instance.

Parameters:
  `target` - the target to write to, or `null` to start with an uninitialized target
  `formatter` - the formatter to use

### Method Detail

#### setTarget

    public void setTarget​(ConsoleHandler.Target target)

Set the target for this console handler.

Parameters:
  `target` - the target to write to, or `null` to clear the target

#### setOutputStream

    public void setOutputStream​(java.io.OutputStream outputStream)

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:
  `setOutputStream` in class `OutputStreamHandler`
Parameters:
  `outputStream` - the new output stream or `null` for none