Class AbstractJacksonLogEventParser
- java.lang.Object
-
- org.apache.logging.log4j.core.parser.AbstractJacksonLogEventParser
-
- All Implemented Interfaces:
LogEventParser,TextLogEventParser
- Direct Known Subclasses:
JsonLogEventParser,XmlLogEventParser,YamlLogEventParser
class AbstractJacksonLogEventParser extends java.lang.Object implements TextLogEventParser
-
-
Field Summary
Fields Modifier and Type Field Description private com.fasterxml.jackson.databind.ObjectReaderobjectReader
-
Constructor Summary
Constructors Constructor Description AbstractJacksonLogEventParser(com.fasterxml.jackson.databind.ObjectMapper objectMapper)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description LogEventparseFrom(byte[] input)Parses a byte array, which is expected to contain exactly one log event.LogEventparseFrom(byte[] input, int offset, int length)Parses a specified range in a byte array.LogEventparseFrom(java.lang.String input)Parses a String, which is expected to contain exactly one log event.
-
-
-
Method Detail
-
parseFrom
public LogEvent parseFrom(java.lang.String input) throws ParseException
Description copied from interface:TextLogEventParserParses a String, which is expected to contain exactly one log event.- Specified by:
parseFromin interfaceTextLogEventParser- Parameters:
input- the string- Returns:
- the parsed LogEvent, never null.
- Throws:
ParseException- if the input is malformed and cannot be parsed as a LogEvent
-
parseFrom
public LogEvent parseFrom(byte[] input) throws ParseException
Description copied from interface:LogEventParserParses a byte array, which is expected to contain exactly one log event.- Specified by:
parseFromin interfaceLogEventParser- Parameters:
input- the byte array- Returns:
- the parsed LogEvent, never null.
- Throws:
ParseException- if the input is malformed and cannot be parsed as a LogEvent
-
parseFrom
public LogEvent parseFrom(byte[] input, int offset, int length) throws ParseException
Description copied from interface:LogEventParserParses a specified range in a byte array. The specified range is expected to contain exactly one log event.- Specified by:
parseFromin interfaceLogEventParser- Parameters:
input- the byte arrayoffset- the initial offsetlength- the length- Returns:
- the parsed LogEvent, never null.
- Throws:
ParseException- if the input is malformed and cannot be parsed as a LogEvent
-
-