public class Slf4jStructuredEventLog extends Object implements StructuredEventLog
| Modifier and Type | Field and Description |
|---|---|
static Slf4jStructuredEventLog |
INSTANCE |
| Constructor and Description |
|---|
Slf4jStructuredEventLog() |
| Modifier and Type | Method and Description |
|---|---|
EventResources |
newEventResources()
Create an new event resources object, which can be used across multiple
root events.
|
Event |
newRootEvent()
Create a new root event.
|
Event |
unstash()
Retrieves an event from the call stack.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitnewLoggerpublic static final Slf4jStructuredEventLog INSTANCE
public Event newRootEvent()
StructuredEventLognewRootEvent in interface StructuredEventLogpublic EventResources newEventResources()
StructuredEventLognewEventResources in interface StructuredEventLogpublic Event unstash()
StructuredEventLog
void method1() {
Event e = logger.newRootEvent()
.timed()
.resource("foo", bar);
e.stash();
unmodifiableMethod();
e.log(Events.METHOD1);
}
void unmodifiableMethod() {
logger.unstash().newChildEvent().log(Events.METHOD2);
}
This should be used sparingly.unstash in interface StructuredEventLogCopyright © 2017–2022 Apache Software Foundation. All rights reserved.