public interface StructuredEventLog
StructuredEventLog logger = StructuredEventLog.newLogger();
logger.newRootEvent()
.resource("remote", remoteAddr)
.resource("local", localAddr)
.attr("path", request.getPath())
.log(Events.READ_REQUEST);
| Modifier and Type | Method and Description |
|---|---|
EventResources |
newEventResources()
Create an new event resources object, which can be used across multiple
root events.
|
static StructuredEventLog |
newLogger()
Create a new logger object, from which root events can be created.
|
Event |
newRootEvent()
Create a new root event.
|
Event |
unstash()
Retrieves an event from the call stack.
|
Event newRootEvent()
EventResources newEventResources()
Event unstash()
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.static StructuredEventLog newLogger()
Copyright © 2017–2022 Apache Software Foundation. All rights reserved.