- All Implemented Interfaces and Traits:
- HandlerEnhancerDefinition
@CompileStatic
class LoggingCommandHandlerEnhancerDefinition
extends Object
implements HandlerEnhancerDefinition
Defines Axon's HandlerEnhancerDefinition for detailed logging of command handlers executions.
Corresponding Slf4j logger uses 'cargotracking-lib-axon-logging.command-handler-logger
' category and it logs on DEBUG
level. Logger output contains information about
aggregate identifier and sequence number.
Logged output looks similar to this (single line in output):
... cargotracking-lib-axon-logging.command-handler-logger : Executing CommandHandler constructor [PredmetAggregate(CreatePredmetCommand,PredmetClassificationDomainService)]
with command [CreatePredmetCommand(aggregateIdentifier: 0eb588a9-cfeb-4be5-8ea9-04c9d14b7df9)]
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 LoggingEventHandlerEnhancerDefinition
and LoggingEventSourcingHandlerEnhancerDefinition.