Package com.log4rich.layouts
Class StandardLayout
java.lang.Object
com.log4rich.layouts.StandardLayout
- All Implemented Interfaces:
Layout
Standard layout implementation with pattern support.
Supports various placeholders for formatting log messages.
-
Constructor Summary
ConstructorsConstructorDescriptionCreates a new StandardLayout with the default pattern.StandardLayout
(String pattern) Creates a new StandardLayout with the specified pattern. -
Method Summary
Modifier and TypeMethodDescriptionformat
(LoggingEvent event) Format a logging event into a string.Gets the pattern used by this layout.boolean
Check if this layout handles throwables.
-
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
Creates a new StandardLayout with the specified pattern.- Parameters:
pattern
- the pattern to use for formatting, or null for default
-
-
Method Details
-
format
Description copied from interface:Layout
Format a logging event into a string. -
ignoresThrowable
public boolean ignoresThrowable()Description copied from interface:Layout
Check if this layout handles throwables.- Specified by:
ignoresThrowable
in interfaceLayout
- Returns:
- true if layout includes throwable information
-
getPattern
Gets the pattern used by this layout.- Returns:
- the pattern string
-