Module logstash.logback.encoder
Class ArgumentsJsonProvider
java.lang.Object
ch.qos.logback.core.spi.ContextAwareBase
net.logstash.logback.composite.AbstractJsonProvider<ILoggingEvent>
net.logstash.logback.composite.AbstractFieldJsonProvider<ILoggingEvent>
net.logstash.logback.composite.loggingevent.ArgumentsJsonProvider
- All Implemented Interfaces:
ContextAware,FieldNamesAware<LogstashFieldNames>,JsonProvider<ILoggingEvent>
public class ArgumentsJsonProvider
extends AbstractFieldJsonProvider<ILoggingEvent>
implements FieldNamesAware<LogstashFieldNames>
Include the logging event's
ILoggingEvent.getArgumentArray() in the JSON output.
Arguments that are an instance of StructuredArgument will be output
as specified by StructuredArgument.writeTo(JsonGenerator).
Non-StructuredArguments will be omitted unless includeNonStructuredArguments is true.
When true, they will be included in the JSON output as separate fields
whose names are nonStructuredArgumentsFieldPrefix plus the argument index.
(For example, "arg0").
-
Field Summary
Fields inherited from class ch.qos.logback.core.spi.ContextAwareBase
context -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanbooleanvoidsetFieldNames(LogstashFieldNames fieldNames) voidsetIncludeNonStructuredArguments(boolean includeNonStructuredArguments) voidsetIncludeStructuredArguments(boolean includeStructuredArguments) voidsetNonStructuredArgumentsFieldPrefix(String nonStructuredArgumentsFieldPrefix) 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, prepareForDeferredProcessing, 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
-
Constructor Details
-
ArgumentsJsonProvider
public ArgumentsJsonProvider()
-
-
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
-
isIncludeStructuredArguments
public boolean isIncludeStructuredArguments() -
setIncludeStructuredArguments
public void setIncludeStructuredArguments(boolean includeStructuredArguments) -
isIncludeNonStructuredArguments
public boolean isIncludeNonStructuredArguments() -
setIncludeNonStructuredArguments
public void setIncludeNonStructuredArguments(boolean includeNonStructuredArguments) -
getNonStructuredArgumentsFieldPrefix
-
setNonStructuredArgumentsFieldPrefix
-
setFieldNames
- Specified by:
setFieldNamesin interfaceFieldNamesAware<LogstashFieldNames>
-