Package com.mapr.log4j
Class PatternLayoutByLevelWithHeader
java.lang.Object
org.apache.log4j.Layout
org.apache.log4j.PatternLayout
com.mapr.log4j.PatternLayoutByLevelWithHeader
- All Implemented Interfaces:
org.apache.log4j.spi.OptionHandler
public class PatternLayoutByLevelWithHeader
extends org.apache.log4j.PatternLayout
Customized PatternLayout to allow setting different layouts per log level
also overwriting such useful methods as getHeader() and may be getFooter
-
Field Summary
Fields inherited from class org.apache.log4j.PatternLayout
BUF_SIZE, DEFAULT_CONVERSION_PATTERN, MAX_CAPACITY, TTCC_CONVERSION_PATTERNFields inherited from class org.apache.log4j.Layout
LINE_SEP, LINE_SEP_LEN -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionformat(org.apache.log4j.spi.LoggingEvent event) Produces a formatted string according to the conversion pattern set for the level of the logging event passed in.voidsetConversionPattern(String conversionPattern) Set the ConversionPattern option.voidsetDebugPattern(String pattern) Set the ConversionPattern option for logging at the DEBUG level.voidsetErrorPattern(String pattern) Set the ConversionPattern option for logging at the ERROR level.voidsetFatalPattern(String pattern) Set the ConversionPattern option for logging at the FATAL level.voidsetInfoPattern(String pattern) Set the ConversionPattern option for logging at the INFO level.voidsetWarnPattern(String pattern) Set the ConversionPattern option for logging at the WARN level.Methods inherited from class org.apache.log4j.PatternLayout
activateOptions, createPatternParser, getConversionPattern, ignoresThrowableMethods inherited from class org.apache.log4j.Layout
getContentType
-
Constructor Details
-
PatternLayoutByLevelWithHeader
public PatternLayoutByLevelWithHeader() -
PatternLayoutByLevelWithHeader
-
-
Method Details
-
setConversionPattern
Set the ConversionPattern option. This is the string which controls formatting and consists of a mix of literal content and conversion specifiers. This will be the pattern for log levels that do not have a pattern set for them.- Overrides:
setConversionPatternin classorg.apache.log4j.PatternLayout- Parameters:
conversionPattern- pattern string to set to.
-
setDebugPattern
Set the ConversionPattern option for logging at the DEBUG level.- Parameters:
pattern- pattern string for logging at the DEBUG level.
-
setInfoPattern
Set the ConversionPattern option for logging at the INFO level.- Parameters:
pattern- pattern string for logging at the INFO level.
-
setWarnPattern
Set the ConversionPattern option for logging at the WARN level.- Parameters:
pattern- pattern string for logging at the WARN level.
-
setErrorPattern
Set the ConversionPattern option for logging at the ERROR level.- Parameters:
pattern- pattern string for logging at the ERROR level.
-
setFatalPattern
Set the ConversionPattern option for logging at the FATAL level.- Parameters:
pattern- pattern string for logging at the FATAL level.
-
format
Produces a formatted string according to the conversion pattern set for the level of the logging event passed in.- Overrides:
formatin classorg.apache.log4j.PatternLayout- Parameters:
event- log event to format an entry for.- Returns:
- a formatted log entry.
-
getHeader
- Overrides:
getHeaderin classorg.apache.log4j.Layout
-