org.wildfly.swarm.logging

## Class LoggingFraction

- java.lang.Object
- - org.wildfly.swarm.config.Logging<LoggingFraction>
  - - org.wildfly.swarm.logging.LoggingFraction

- All Implemented Interfaces:
    Fraction<LoggingFraction>

      public class LoggingFraction
      extends Logging<LoggingFraction>
      implements Fraction<LoggingFraction>

  Author:
    Bob McWhirter, Ken Finnigan, Lance Ball

- - ### Nested Class Summary

    - ### Nested classes/interfaces inherited from class org.wildfly.swarm.config.Logging

      `Logging.LoggingResources`

  - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static String` | `COLOR_PATTERN`
    `static String` | `CONSOLE`
    `static String` | `PATTERN`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `LoggingFraction()`

  - ### Method Summary

    All Methods Static Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `LoggingFraction` | `applyDefaults()` Apply whatever defaults are required if this fraction was not explicitly configured by a user.
    `LoggingFraction` | `applyDefaults(Level level)`
    `List<AsyncHandler>` | `asyncHandlers()` Get the list of AsyncHandlers for this logger
    `LoggingFraction` | `consoleHandler(Level level, String formatter)` Add a ConsoleHandler to the list of handlers for this logger.
    `List<ConsoleHandler>` | `consoleHandlers()` Get the list of ConsoleHandlers for this logger
    `static LoggingFraction` | `createDebugLoggingFraction()` Create a default DEBUG logging fraction.
    `static LoggingFraction` | `createDefaultLoggingFraction()` Create a default INFO logging fraction.
    `static LoggingFraction` | `createDefaultLoggingFraction(Level level)` Create a default logging fraction for the specified level.
    `static LoggingFraction` | `createErrorLoggingFraction()` Create a default ERROR logging fraction.
    `static LoggingFraction` | `createTraceLoggingFraction()` Create a default TRACE logging fraction.
    `LoggingFraction` | `customFormatter(String name, String module, String className)` Add a CustomFormatter to this logger
    `LoggingFraction` | `customFormatter(String name, String module, String className, Properties properties)` Add a CustomFormatter to this logger
    `List<CustomFormatter>` | `customFormatters()` Get the list of CustomFormatter configurations
    `LoggingFraction` | `customHandler(String name, String module, String className, Properties properties, String formatter)` Add a CustomHandler to this logger
    `List<CustomHandler>` | `customHandlers()` Get the list of CustomHandlers for this logger
    `LoggingFraction` | `defaultColorFormatter()` Configure a default color formatter named `COLOR_PATTERN`.
    `LoggingFraction` | `defaultFormatter()` Configure a default non-color formatter named `PATTERN`.
    `LoggingFraction` | `fileHandler(String name, String path, Level level, String formatter)` Add a FileHandler to the list of handlers for this logger
    `List<FileHandler>` | `fileHandlers()` Get the list of FileHandlers configured on this logger
    `LoggingFraction` | `formatter(String name, String pattern)` Add a new PatternFormatter to this Logger
    `List<PatternFormatter>` | `patternFormatters()` Get the list of PatternFormatter configurations
    `LoggingFraction` | `rootLogger(Level level, String... handlers)` Add a root logger to this fraction
    `List<SyslogHandler>` | `syslogHandlers()` Get the list of SyslogHandlers for this logger

    - ### Methods inherited from class org.wildfly.swarm.config.Logging

      `addLoggingApiDependencies, addLoggingApiDependencies, addPropertyChangeListener, asyncHandler, asyncHandler, asyncHandler, asyncHandler, asyncHandlers, consoleHandler, consoleHandler, consoleHandler, consoleHandler, consoleHandlers, customFormatter, customFormatter, customFormatter, customFormatter, customFormatters, customHandler, customHandler, customHandler, customHandler, customHandlers, fileHandler, fileHandler, fileHandler, fileHandler, fileHandlers, getKey, logFile, logFile, logFile, logFile, logFiles, logger, logger, logger, logger, loggers, loggingProfile, loggingProfile, loggingProfile, loggingProfile, loggingProfiles, patternFormatter, patternFormatter, patternFormatter, patternFormatter, patternFormatters, periodicRotatingFileHandler, periodicRotatingFileHandler, periodicRotatingFileHandler, periodicRotatingFileHandler, periodicRotatingFileHandlers, periodicSizeRotatingFileHandler, periodicSizeRotatingFileHandler, periodicSizeRotatingFileHandler, periodicSizeRotatingFileHandler, periodicSizeRotatingFileHandlers, removePropertyChangeListener, rootLogger, rootLogger, rootLogger, rootLogger, sizeRotatingFileHandler, sizeRotatingFileHandler, sizeRotatingFileHandler, sizeRotatingFileHandler, sizeRotatingFileHandlers, subresources, syslogHandler, syslogHandler, syslogHandler, syslogHandler, syslogHandlers, useDeploymentLoggingConfig, useDeploymentLoggingConfig`

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

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

    - ### Methods inherited from interface org.wildfly.swarm.spi.api.Fraction

      `applyDefaults`

- - ### Field Detail

    - #### CONSOLE

          public static final String CONSOLE

      See Also:
        Constant Field Values

    - #### PATTERN

          public static final String PATTERN

      See Also:
        Constant Field Values

    - #### COLOR_PATTERN

          public static final String COLOR_PATTERN

      See Also:
        Constant Field Values

  - ### Constructor Detail

    - #### LoggingFraction

          public LoggingFraction()

  - ### Method Detail

    - #### applyDefaults

          public LoggingFraction applyDefaults()

      Description copied from interface: `Fraction`
      Apply whatever defaults are required if this fraction was not explicitly configured by a user.
      Specified by:
        `applyDefaults` in interface `Fraction<LoggingFraction>`
      Returns:
        this fraction.

    - #### applyDefaults

          public LoggingFraction applyDefaults(Level level)

    - #### createTraceLoggingFraction

          public static LoggingFraction createTraceLoggingFraction()

      Create a default TRACE logging fraction.
      Returns:
        The fully-configured fraction.

    - #### createDebugLoggingFraction

          public static LoggingFraction createDebugLoggingFraction()

      Create a default DEBUG logging fraction.
      Returns:
        The fully-configured fraction.

    - #### createErrorLoggingFraction

          public static LoggingFraction createErrorLoggingFraction()

      Create a default ERROR logging fraction.
      Returns:
        The fully-configured fraction.

    - #### createDefaultLoggingFraction

          public static LoggingFraction createDefaultLoggingFraction()

      Create a default INFO logging fraction.
      Returns:
        The fully-configured fraction.

    - #### createDefaultLoggingFraction

          public static LoggingFraction createDefaultLoggingFraction(Level level)

      Create a default logging fraction for the specified level.
      Returns:
        The fully-configured fraction.

    - #### defaultFormatter

          public LoggingFraction defaultFormatter()

      Configure a default non-color formatter named `PATTERN`.
      Returns:
        This fraction.

    - #### defaultColorFormatter

          public LoggingFraction defaultColorFormatter()

      Configure a default color formatter named `COLOR_PATTERN`.
      Returns:
        This fraction.

    - #### formatter

          public LoggingFraction formatter(String name,
                                           String pattern)

      Add a new PatternFormatter to this Logger
      Parameters:
        `name` - the name of the formatter
        `pattern` - the pattern string
      Returns:
        This fraction.

    - #### customFormatter

          public LoggingFraction customFormatter(String name,
                                                 String module,
                                                 String className)

      Add a CustomFormatter to this logger
      Parameters:
        `name` - the name of the formatter
        `module` - the module that the logging handler depends on
        `className` - the logging handler class to be used
      Returns:
        This fraction.

    - #### customFormatter

          public LoggingFraction customFormatter(String name,
                                                 String module,
                                                 String className,
                                                 Properties properties)

      Add a CustomFormatter to this logger
      Parameters:
        `name` - the name of the formatter
        `module` - the module that the logging handler depends on
        `className` - the logging handler class to be used
        `properties` - the properties
      Returns:
        this fraction

    - #### patternFormatters

          public List<PatternFormatter> patternFormatters()

      Get the list of PatternFormatter configurations
      Returns:
        The list of formatters

    - #### customFormatters

          public List<CustomFormatter> customFormatters()

      Get the list of CustomFormatter configurations
      Returns:
        The list of custom formatters

    - #### consoleHandler

          public LoggingFraction consoleHandler(Level level,
                                                String formatter)

      Add a ConsoleHandler to the list of handlers for this logger.
      Parameters:
        `level` - The logging level
        `formatter` - A pattern string for the console's formatter
      Returns:
        This fraction

    - #### consoleHandlers

          public List<ConsoleHandler> consoleHandlers()

      Get the list of ConsoleHandlers for this logger
      Returns:
        the list of handlers

    - #### fileHandler

          public LoggingFraction fileHandler(String name,
                                             String path,
                                             Level level,
                                             String formatter)

      Add a FileHandler to the list of handlers for this logger
      Parameters:
        `name` - The name of the handler
        `path` - The log file path
        `level` - The logging level
        `formatter` - The pattern string for the formatter
      Returns:
        This fraction

    - #### fileHandlers

          public List<FileHandler> fileHandlers()

      Get the list of FileHandlers configured on this logger
      Returns:
        the list of FileHandlers

    - #### customHandler

          public LoggingFraction customHandler(String name,
                                               String module,
                                               String className,
                                               Properties properties,
                                               String formatter)

      Add a CustomHandler to this logger
      Parameters:
        `name` - the name of the handler
        `module` - the module that the handler uses
        `className` - the handler class name
        `properties` - properties for the handler
        `formatter` - a pattern string for the formatter
      Returns:
        this fraction

    - #### customHandlers

          public List<CustomHandler> customHandlers()

      Get the list of CustomHandlers for this logger
      Returns:
        the list of handlers

    - #### asyncHandlers

          public List<AsyncHandler> asyncHandlers()

      Get the list of AsyncHandlers for this logger
      Returns:
        the list of handlers

    - #### syslogHandlers

          public List<SyslogHandler> syslogHandlers()

      Get the list of SyslogHandlers for this logger
      Returns:
        the list of handlers

    - #### rootLogger

          public LoggingFraction rootLogger(Level level,
                                            String... handlers)

      Add a root logger to this fraction
      Parameters:
        `level` - the log level
        `handlers` - a list of handlers
      Returns:
        this fraction

Copyright © 2018 JBoss by Red Hat. All rights reserved.