public class LogstashAccessFormatter extends Object
| Modifier and Type | Field and Description |
|---|---|
protected ch.qos.logback.core.spi.ContextAware |
contextAware |
protected FieldNamesType |
fieldNames
The field names to use when writing the standard event fields
|
static String |
IGNORE_FIELD_INDICATOR
Field name to use in logback configuration files
if you want the field to be ignored (not output).
|
protected static org.apache.commons.lang.time.FastDateFormat |
ISO_DATETIME_TIME_ZONE_FORMAT_WITH_MILLIS |
| Constructor and Description |
|---|
LogstashAccessFormatter(ch.qos.logback.core.spi.ContextAware contextAware) |
| Modifier and Type | Method and Description |
|---|---|
FieldNamesType |
getFieldNames() |
com.fasterxml.jackson.core.JsonFactory |
getJsonFactory() |
JsonFactoryDecorator |
getJsonFactoryDecorator() |
JsonGeneratorDecorator |
getJsonGeneratorDecorator() |
boolean |
isStarted() |
void |
setFieldNames(FieldNamesType fieldNames) |
void |
setJsonFactoryDecorator(JsonFactoryDecorator jsonFactoryDecorator) |
void |
setJsonGeneratorDecorator(JsonGeneratorDecorator jsonGeneratorDecorator) |
void |
start() |
void |
stop() |
protected void |
writeMapEntries(com.fasterxml.jackson.core.JsonGenerator generator,
Map<?,?> map) |
protected void |
writeNumberField(com.fasterxml.jackson.core.JsonGenerator generator,
String fieldName,
int fieldValue)
Writes the field to the generator if and only if the fieldName is not null.
|
protected void |
writeNumberField(com.fasterxml.jackson.core.JsonGenerator generator,
String fieldName,
long fieldValue)
Writes the field to the generator if and only if the fieldName is not null.
|
protected void |
writeStringField(com.fasterxml.jackson.core.JsonGenerator generator,
String fieldName,
String fieldValue)
Writes the field to the generator if and only if the fieldName and fieldValue are not null.
|
byte[] |
writeValueAsBytes(EventType event,
ch.qos.logback.core.Context context) |
String |
writeValueAsString(EventType event,
ch.qos.logback.core.Context context) |
protected void |
writeValueToGenerator(com.fasterxml.jackson.core.JsonGenerator generator,
ch.qos.logback.access.spi.IAccessEvent event,
ch.qos.logback.core.Context context) |
void |
writeValueToOutputStream(EventType event,
ch.qos.logback.core.Context context,
OutputStream outputStream) |
public static final String IGNORE_FIELD_INDICATOR
protected static final org.apache.commons.lang.time.FastDateFormat ISO_DATETIME_TIME_ZONE_FORMAT_WITH_MILLIS
protected FieldNamesType extends LogstashCommonFieldNames fieldNames
protected final ch.qos.logback.core.spi.ContextAware contextAware
public LogstashAccessFormatter(ch.qos.logback.core.spi.ContextAware contextAware)
protected void writeValueToGenerator(com.fasterxml.jackson.core.JsonGenerator generator,
ch.qos.logback.access.spi.IAccessEvent event,
ch.qos.logback.core.Context context)
throws IOException
IOExceptionpublic void start()
start in interface ch.qos.logback.core.spi.LifeCyclepublic void stop()
stop in interface ch.qos.logback.core.spi.LifeCyclepublic boolean isStarted()
isStarted in interface ch.qos.logback.core.spi.LifeCyclepublic com.fasterxml.jackson.core.JsonFactory getJsonFactory()
public byte[] writeValueAsBytes(EventType event,
ch.qos.logback.core.Context context)
throws IOException
IOExceptionpublic void writeValueToOutputStream(EventType event,
ch.qos.logback.core.Context context,
OutputStream outputStream)
throws IOException
IOExceptionpublic String writeValueAsString(EventType event, ch.qos.logback.core.Context context) throws IOException
IOExceptionprotected void writeMapEntries(com.fasterxml.jackson.core.JsonGenerator generator,
Map<?,?> map)
throws IOException,
com.fasterxml.jackson.databind.JsonMappingException
IOExceptioncom.fasterxml.jackson.databind.JsonMappingExceptionprotected void writeStringField(com.fasterxml.jackson.core.JsonGenerator generator,
String fieldName,
String fieldValue)
throws IOException
IOExceptionprotected void writeNumberField(com.fasterxml.jackson.core.JsonGenerator generator,
String fieldName,
int fieldValue)
throws IOException
IOExceptionprotected void writeNumberField(com.fasterxml.jackson.core.JsonGenerator generator,
String fieldName,
long fieldValue)
throws IOException
IOExceptionpublic FieldNamesType getFieldNames()
public void setFieldNames(FieldNamesType fieldNames)
public JsonFactoryDecorator getJsonFactoryDecorator()
public void setJsonFactoryDecorator(JsonFactoryDecorator jsonFactoryDecorator)
public JsonGeneratorDecorator getJsonGeneratorDecorator()
public void setJsonGeneratorDecorator(JsonGeneratorDecorator jsonGeneratorDecorator)
Copyright © 2014. All Rights Reserved.