Class StandardLayout

java.lang.Object
com.log4rich.layouts.StandardLayout
All Implemented Interfaces:
Layout

public class StandardLayout extends Object implements Layout
Standard layout implementation with pattern support. Supports various placeholders for formatting log messages.
  • Constructor Details

    • StandardLayout

      public StandardLayout()
      Creates a new StandardLayout with the default pattern. Default pattern: "[%level] %date{yyyy-MM-dd HH:mm:ss} [%thread] %class.%method:%line - %message%n"
    • StandardLayout

      public StandardLayout(String pattern)
      Creates a new StandardLayout with the specified pattern.
      Parameters:
      pattern - the pattern to use for formatting, or null for default
  • Method Details

    • format

      public String format(LoggingEvent event)
      Description copied from interface: Layout
      Format a logging event into a string.
      Specified by:
      format in interface Layout
      Parameters:
      event - The logging event to format
      Returns:
      The formatted string
    • ignoresThrowable

      public boolean ignoresThrowable()
      Description copied from interface: Layout
      Check if this layout handles throwables.
      Specified by:
      ignoresThrowable in interface Layout
      Returns:
      true if layout includes throwable information
    • getPattern

      public String getPattern()
      Gets the pattern used by this layout.
      Returns:
      the pattern string