Interface EventResources
- All Known Implementing Classes:
EventResourcesImpl
public interface EventResources
A container for resources
The container allows resources to be shared across multiple
events with different root events. An example usage of this would be used
for a server connection. We want all events initiated on the connection to
share resource values, such as remote and local socket. However, each root
event on the connection may be for a different trace.
-
Method Summary
Modifier and TypeMethodDescriptionAdd a resource for the event.Add a resource for the event using a supplier.
-
Method Details
-
resource
Add a resource for the event. Resources are inherited by child events.- Parameters:
key- the key to identify the resourcevalue- the value which will be logged for the resource. This is converted to a string before logging.- Returns:
- this
-
resource
Add a resource for the event using a supplier. The supplier is used in the case that generating the string from the object is expensive or we want to generate a custom string.- Parameters:
key- the key to identify the resourcevalue- a supplier which returns the value to be logged for this resource- See Also:
-