public class CallerDataJsonProvider extends AbstractFieldJsonProvider<ILoggingEvent> implements FieldNamesAware<LogstashFieldNames>
Modifier and Type | Field and Description |
---|---|
static String |
FIELD_CALLER_CLASS_NAME |
static String |
FIELD_CALLER_FILE_NAME |
static String |
FIELD_CALLER_LINE_NUMBER |
static String |
FIELD_CALLER_METHOD_NAME |
context
Constructor and Description |
---|
CallerDataJsonProvider() |
Modifier and Type | Method and Description |
---|---|
String |
getClassFieldName() |
String |
getFileFieldName() |
String |
getLineFieldName() |
String |
getMethodFieldName() |
void |
prepareForDeferredProcessing(ILoggingEvent event)
Gives the provider a chance to perform more deferred processing
(in addition to what is already provided by
DeferredProcessingAware.prepareForDeferredProcessing() ). |
void |
setClassFieldName(String callerClassFieldName) |
void |
setFieldNames(LogstashFieldNames fieldNames) |
void |
setFileFieldName(String callerFileFieldName) |
void |
setLineFieldName(String callerLineFieldName) |
void |
setMethodFieldName(String callerMethodFieldName) |
void |
writeTo(JsonGenerator generator,
ILoggingEvent event)
Writes information about the event, to the given generator.
|
getFieldName, setFieldName
isStarted, start, stop
addError, addError, addInfo, addInfo, addStatus, addWarn, addWarn, getContext, getDeclaredOrigin, getStatusManager, setContext
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
addError, addError, addInfo, addInfo, addStatus, addWarn, addWarn, getContext, setContext
public static final String FIELD_CALLER_CLASS_NAME
public static final String FIELD_CALLER_METHOD_NAME
public static final String FIELD_CALLER_FILE_NAME
public static final String FIELD_CALLER_LINE_NUMBER
public void writeTo(JsonGenerator generator, ILoggingEvent event) throws IOException
JsonProvider
When called, the generator is assumed to be within a JSON object context (i.e. this provider should write fields and their values to the generator). Upon return, the generator should be within the same JSON object context.
writeTo
in interface JsonProvider<ILoggingEvent>
generator
- the JsonGenerator
to produce JSON contentevent
- the event to convert into JSONIOException
- if an I/O error occurspublic void prepareForDeferredProcessing(ILoggingEvent event)
JsonProvider
DeferredProcessingAware.prepareForDeferredProcessing()
).prepareForDeferredProcessing
in interface JsonProvider<ILoggingEvent>
prepareForDeferredProcessing
in class AbstractJsonProvider<ILoggingEvent>
event
- the event to prepare for deferred processingpublic void setFieldNames(LogstashFieldNames fieldNames)
setFieldNames
in interface FieldNamesAware<LogstashFieldNames>
public String getClassFieldName()
public void setClassFieldName(String callerClassFieldName)
public String getMethodFieldName()
public void setMethodFieldName(String callerMethodFieldName)
public String getFileFieldName()
public void setFileFieldName(String callerFileFieldName)
public String getLineFieldName()
public void setLineFieldName(String callerLineFieldName)
Copyright © 2013–2022. All rights reserved.