- java.lang.Object
-
- com.pervasive.datarush.operators.io.textfile.AbstractRegexLogFormat
-
- com.pervasive.datarush.operators.io.textfile.Log4jLogFormat
-
- All Implemented Interfaces:
LogFormat
public class Log4jLogFormat extends AbstractRegexLogFormat
Describes the format of a log4j log file. Should use the same string specified in the log4j.properties file for *.layout.ConversionPattern as the format pattern. See org.apache.log4j.EnhancedPatternLayout for more information on valid format patterns.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class com.pervasive.datarush.operators.io.textfile.AbstractRegexLogFormat
AbstractRegexLogFormat.RegexParser
-
-
Field Summary
Fields Modifier and Type Field Description protected RecordTextSchema<?>schema-
Fields inherited from class com.pervasive.datarush.operators.io.textfile.AbstractRegexLogFormat
formatPattern, logType
-
-
Constructor Summary
Constructors Constructor Description Log4jLogFormat()Create a log format for accessing log4j log data.Log4jLogFormat(String formatPattern)Create a log format for accessing log4j log data.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description DataFormat.DataParsercreateParser(ParsingOptions options, CharsetEncoding charEncoding, String newline)List<String>getCustomLevelDefinitions()Gets the custom level definitions.RecordTextSchema<?>getSchema()Gets the record schema of the source.RecordTokenTypegetType()Gets the record type associated with the format.booleanisSplittable()Indicates if the format supports parsing of subsections of a file.protected voidrefreshSchema()Refresh and recalculate the schema.voidsetCustomLevelDefinitions(List<String> customLevelDefinitions)Sets the custom level definitions.voidsetFormatPattern(String formatPattern)Set the value used for the log format pattern-
Methods inherited from class com.pervasive.datarush.operators.io.textfile.AbstractRegexLogFormat
analyzeFormat, getFormatPattern, getLogType, setAnalysis
-
-
-
-
Field Detail
-
schema
protected RecordTextSchema<?> schema
-
-
Constructor Detail
-
Log4jLogFormat
public Log4jLogFormat()
Create a log format for accessing log4j log data.
-
Log4jLogFormat
public Log4jLogFormat(String formatPattern)
Create a log format for accessing log4j log data.- Parameters:
formatPattern- the log4j pattern that determines the schema
-
-
Method Detail
-
setCustomLevelDefinitions
public void setCustomLevelDefinitions(List<String> customLevelDefinitions)
Sets the custom level definitions. The default level names are: TRACE, DEBUG, INFO, WARN, ERROR, FATAL- Parameters:
customLevelDefinitions- the custom level definition list
-
getCustomLevelDefinitions
public List<String> getCustomLevelDefinitions()
Gets the custom level definitions.- Returns:
- the list of custom level names
-
setFormatPattern
public void setFormatPattern(String formatPattern)
Description copied from class:AbstractRegexLogFormatSet the value used for the log format pattern- Specified by:
setFormatPatternin interfaceLogFormat- Overrides:
setFormatPatternin classAbstractRegexLogFormat- Parameters:
formatPattern- the value to use as the format pattern
-
getType
public RecordTokenType getType()
Description copied from interface:LogFormatGets the record type associated with the format. Records produced by the associated parser or consumed by the associated formatter will be of this type.For many formats, this may be derived from a schema object describing the format layout.
- Returns:
- the format's record type
-
getSchema
public RecordTextSchema<?> getSchema()
Description copied from class:AbstractRegexLogFormatGets the record schema of the source.- Specified by:
getSchemain classAbstractRegexLogFormat- Returns:
- the record schema of the source
-
refreshSchema
protected void refreshSchema()
Description copied from class:AbstractRegexLogFormatRefresh and recalculate the schema. This is usually done after changing a setting.- Specified by:
refreshSchemain classAbstractRegexLogFormat
-
isSplittable
public boolean isSplittable()
Description copied from interface:LogFormatIndicates if the format supports parsing of subsections of a file.A format should only return
trueif it can, at least in some situations, support this sort of parsing. If a format requires reading the entire file, it must returnfalse.If a format is not splittable, a file in the format cannot be parsed in parallel; however, individual files can still be parsed independently in parallel, as when reading the contents of a directory or using a file globbing pattern.
- Specified by:
isSplittablein interfaceLogFormat- Overrides:
isSplittablein classAbstractRegexLogFormat- Returns:
trueif the format supports parsing only a portion of the file,falseotherwise
-
createParser
public DataFormat.DataParser createParser(ParsingOptions options, CharsetEncoding charEncoding, String newline)
-
-