Package net.logstash.logback.composite
Class UuidJsonProvider<Event extends DeferredProcessingAware>
java.lang.Object
ch.qos.logback.core.spi.ContextAwareBase
net.logstash.logback.composite.AbstractJsonProvider<Event>
net.logstash.logback.composite.AbstractFieldJsonProvider<Event>
net.logstash.logback.composite.UuidJsonProvider<Event>
- All Implemented Interfaces:
ContextAware,JsonProvider<Event>
- Direct Known Subclasses:
UuidProvider
public class UuidJsonProvider<Event extends DeferredProcessingAware>
extends AbstractFieldJsonProvider<Event>
Outputs random UUID as field value.
Handy when you want to provide unique identifier for log lines.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final Stringstatic final StringType 4 UUID.static final StringType 1 time based UUID.Fields inherited from class ch.qos.logback.core.spi.ContextAwareBase
context -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidsetEthernet(String ethernet) voidsetStrategy(String strategy) voidwriteTo(JsonGenerator generator, Event 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
-
Field Details
-
FIELD_UUID
- See Also:
-
STRATEGY_RANDOM
Type 4 UUID.- See Also:
-
STRATEGY_TIME
Type 1 time based UUID. When the time strategy is used, thenethernetcan be set to either 'interface' (to automatically pick a MAC address from a network interface) or a MAC address string.- See Also:
-
-
Constructor Details
-
UuidJsonProvider
public UuidJsonProvider()
-
-
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.
- Parameters:
generator- theJsonGeneratorto produce JSON contentevent- the event to convert into JSON- Throws:
IOException- if an I/O error occurs
-
getStrategy
-
setStrategy
-
getEthernet
-
setEthernet
-