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
Modifier and TypeFieldDescriptionstatic final String
static final String
Type 4 UUID.static final String
Type 1 time based UUID.Fields inherited from class ch.qos.logback.core.spi.ContextAwareBase
context
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
setEthernet
(String ethernet) void
setStrategy
(String strategy) void
writeTo
(JsonGenerator generator, Event event) Writes information about the event, to the given generator.Methods inherited from class net.logstash.logback.composite.AbstractFieldJsonProvider
getFieldName, setFieldName
Methods inherited from class net.logstash.logback.composite.AbstractJsonProvider
assertIsStarted, isStarted, prepareForDeferredProcessing, start, stop
Methods inherited from class ch.qos.logback.core.spi.ContextAwareBase
addError, addError, addInfo, addInfo, addStatus, addWarn, addWarn, getContext, getDeclaredOrigin, getStatusManager, setContext
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods 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, thenethernet
can 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:JsonProvider
Writes 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
- theJsonGenerator
to produce JSON contentevent
- the event to convert into JSON- Throws:
IOException
- if an I/O error occurs
-
getStrategy
-
setStrategy
-
getEthernet
-
setEthernet
-