Skip to end of metadata
Go to start of metadata
WIP
This is still a work in progress. Please feel free to edit any mistakes you find .

Overview

Handlers are used to determine what happens with a log message if the logger determines the message is loggable.

There are 6 main handlers provided with WildFly and 1 generic handler;

async-handler

An async-handler is a handler that asynchronously writes log messages to it's child handlers. This type of handler is generally used for other handlers that take a substantial time to write logged messages.

Attributes

console-handler

A console-handler is a handler that writes log messages to the console. Generally this writes to stdout, but can be set to write to stderr.

Attributes

file-handler

A file-handler is a handler that writes log messages to the specified file.

Attributes

periodic-rotating-file-handler

A periodic-rotating-file-handler is a handler that writes log messages to the specified file. The file rotates on the date pattern specified in the suffix attribute. The suffix must be a valid pattern recognized by the java.text.SimpleDateFormat and must not rotate on seconds or milliseconds.

The rotate happens before the next message is written by the handler.
Attributes

size-rotating-file-handler

A size-rotating-file-handler is a handler that writes log messages to the specified file. The file rotates when the file size is greater than the rotate-size attribute. The rotated file will be kept and the index appended to the name moving previously rotated file indexes up by 1 until the max-backup-index is reached. Once the max-backup-index is reached, the indexed files will be overwritten.

The rotate happens before the next message is written by the handler.
Attributes

syslog-handler

A syslog-handler is a handler that writes to a syslog server. The handler support RFC3164 or RFC5424 formats.

Attributes
The syslog-handler is missing some configuration properties that may be useful in some scenarios like setting a formatter. Use the org.jboss.logmanager.handlers.SyslogHandler in module org.jboss.logmanager as a custom-handler to exploit these benefits. Additional attributes will be added at some point so this will no longer be necessary.

custom-handler

Attributes

autoflush
Description: Indicates whether a flush should happen after each write.
Type: boolean
Default Value: true
Allowed Values: true or false


enabled
Description: If set to true the handler is enabled and functioning as normal, if set to false the handler is ignored when processing log messages.
Type: boolean
Default Value: true
Allowed Values: true or false


encoding
Description: The character encoding used by this Handler.
Type: string
Default Value: null
Allowed Values: Any valid encoding


file
Description: An object describing the file the handler should write to.
Type: object
Default Value: null
Allowed Values: An object optionally containing a relative-to property and a path. The path is a required property of the object.


named-formatter
Description: The name of a defined formatter to be used on the handler.
Type: string
Default Value: null
Allowed Values: TODO add link


formatter
Description: Defines a pattern for a pattern formatter.
Type: string
Default Value: %d{HH:mm:ss,SSS} %-5p [%c] (%t) %s%E%n
Allowed Values: TODO add link


filter-spec
Description: A filter expression value to define a filter.
Type: string
Default Value: null
Allowed Values: See Filter Expression


level
Description : The log level specifying which message levels will be logged by this logger. Message levels lower than this value will be discarded.
Type: string
Default Value: ALL
Allowed Values:
  • ALL
  • FINEST
  • FINER
  • TRACE
  • DEBUG
  • FINE
  • CONFIG
  • INFO
  • WARN
  • WARNING
  • ERROR
  • SEVERE
  • FATAL
  • OFF


max-backup-index
Description: The maximum number of rotated files to keep.
Type: integer
Default Value: 1
Allowed Values: any integer greater than 0


overflow-action
Description: Specify what action to take when the overflowing.
Type: string
Default Value: BLOCK
Allowed Values: BLOCK or DISCARD


queue-length
Description: The queue length to use before flushing writing
Type: integer
Default Value: 0
Allowed Values: any positive integer


rotate-on-boot
Description: Indicates whether or not the file should be rotated each time the file attribute is changed.
If set to true will rotate on each boot of the server.
Type: boolean
Default Value: false
Allowed Values: true or false


rotate-size
Description: The size at which the file should be rotated.
Type: string
Default Value: 2m
Allowed Values: Any positive integer with a size type appended to the end. Valid types are b for bytes, k for kilobytes, m for megabytes, g for gigabytes or t for terabytes. Type character is not case sensitive.


subhandlers
Description: The handlers to associate with the async handler
Type: list of strings
Default Value: null
Allowed Values: An array of valid handler names


suffix
Description: The pattern used to determine when the file should be rotated.
Type: string
Default Value: null
Allowed Values: Any valid java.text.SimpleDateFormat pattern.


target
Description: Defines the target of the console handler.
Type: string
Default Value: System.out
Allowed Values: System.out or System.err
Labels:
logging logging Delete
handlers handlers Delete
subsystem subsystem Delete
Enter labels to add to this page:
Please wait 
Looking for a label? Just start typing.
  1. Feb 19, 2014

    Is "syslog-handler" available for logger in WildFly 7.1.3.Final as in WildFly 8? Can we use custom-handler with class and module as shown below in the code below for syslog in WildFly8 instead of using custom-handler with class org.jboss.logmanager.handlers.SyslogHandler? 

    Code:

  2. Aug 26, 2014

    Any pointers to the "formatter" docs?  The default apparently puts escape characters into the Eclipse output.

  3. Sep 15, 2014

    It would be really useful if the periodic-rotating-file-handler had a max-backup-index parameter. Any reason it doesn't?

    Thanks

  4. Jun 23, 2015

    Apparently the element custom-handler has additional attributes 'class' and 'module',

    which are not documented on this page. At least when I specify a 'class',

    then the configuration parser complains about a missing 'module' attribute.

    Please document all missing attributes.

    1. Jun 23, 2015

      This is most likely going to be deleted. A better description can be found at http://wildscribe.github.io/