- All Implemented Interfaces and Traits:
- HandlerEnhancerDefinition
@CompileStatic
class LoggingEventSourcingHandlerEnhancerDefinition
extends Object
implements HandlerEnhancerDefinition
Defines Axon's HandlerEnhancerDefinition for detailed logging of event sourcing handlers executions.
Corresponding Slf4j logger uses 'cargotracking-lib-axon-logging.eventsourcing-handler-logger
' category and it logs on DEBUG
level. Logger output contains information
about event's aggregate identifier and event's sequence number.
Logged output looks similar to this (single line in output):
... cargotracking-lib-axon-logging.eventsourcing-handler-logger : Executing EventSourcingHandler method [PredmetAggregate.onPredmetCreatedEvent(PredmetCreatedEvent,DomainEventMessage)]
with event [eventId: 454dbf65-6686-4529-92c3-e973ccd6ece3, PredmetCreatedEvent(aggregateIdentifier: 0eb588a9-cfeb-4be5-8ea9-04c9d14b7df9, sequenceNumber: 0)]
To register this HandlerEnhancerDefinition, use standard means as described in Axon documentation. In Spring Boot applications only a simple bean declaration is required.
Logger output contains information about aggregate identifier and sequence number which enables easy correlation with logging outputs produced by LoggingCommandHandlerEnhancerDefinition
and LoggingEventHandlerEnhancerDefinition.