Class CallerDataJsonProvider
java.lang.Object
ch.qos.logback.core.spi.ContextAwareBase
net.logstash.logback.composite.AbstractJsonProvider<Event>
net.logstash.logback.composite.AbstractFieldJsonProvider<ILoggingEvent>
net.logstash.logback.composite.loggingevent.CallerDataJsonProvider
- All Implemented Interfaces:
ContextAware,FieldNamesAware<LogstashFieldNames>,JsonProvider<ILoggingEvent>
public class CallerDataJsonProvider
extends AbstractFieldJsonProvider<ILoggingEvent>
implements FieldNamesAware<LogstashFieldNames>
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final Stringstatic final Stringstatic final Stringstatic final StringFields inherited from class ch.qos.logback.core.spi.ContextAwareBase
context -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidGives the provider a chance to perform more deferred processing (in addition to what is already provided byDeferredProcessingAware.prepareForDeferredProcessing()).voidsetClassFieldName(String callerClassFieldName) voidsetFieldNames(LogstashFieldNames fieldNames) voidsetFileFieldName(String callerFileFieldName) voidsetLineFieldName(String callerLineFieldName) voidsetMethodFieldName(String callerMethodFieldName) voidwriteTo(JsonGenerator generator, ILoggingEvent event) Writes information about the event, to the given generator.Methods inherited from class net.logstash.logback.composite.AbstractFieldJsonProvider
getFieldName, setFieldNameMethods inherited from class net.logstash.logback.composite.AbstractJsonProvider
assertIsStarted, isStarted, start, stopMethods inherited from class ch.qos.logback.core.spi.ContextAwareBase
addError, addError, addInfo, addInfo, addStatus, addWarn, addWarn, getContext, getDeclaredOrigin, getStatusManager, setContextMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface ch.qos.logback.core.spi.ContextAware
addError, addError, addInfo, addInfo, addStatus, addWarn, addWarn, getContext, setContext
-
Field Details
-
FIELD_CALLER_CLASS_NAME
- See Also:
-
FIELD_CALLER_METHOD_NAME
- See Also:
-
FIELD_CALLER_FILE_NAME
- See Also:
-
FIELD_CALLER_LINE_NUMBER
- See Also:
-
-
Constructor Details
-
CallerDataJsonProvider
public CallerDataJsonProvider()
-
-
Method Details
-
writeTo
Description copied from interface:JsonProviderWrites information about the event, to the given generator.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.
- Specified by:
writeToin interfaceJsonProvider<ILoggingEvent>- Parameters:
generator- theJsonGeneratorto produce JSON contentevent- the event to convert into JSON- Throws:
IOException- if an I/O error occurs
-
prepareForDeferredProcessing
Description copied from interface:JsonProviderGives the provider a chance to perform more deferred processing (in addition to what is already provided byDeferredProcessingAware.prepareForDeferredProcessing()).- Specified by:
prepareForDeferredProcessingin interfaceJsonProvider<ILoggingEvent>- Overrides:
prepareForDeferredProcessingin classAbstractJsonProvider<ILoggingEvent>- Parameters:
event- the event to prepare for deferred processing
-
setFieldNames
- Specified by:
setFieldNamesin interfaceFieldNamesAware<LogstashFieldNames>
-
getClassFieldName
-
setClassFieldName
-
getMethodFieldName
-
setMethodFieldName
-
getFileFieldName
-
setFileFieldName
-
getLineFieldName
-
setLineFieldName
-