I have a question concerning the error logging of Axon. When errors occur on command execution, Axon uses the built logger and logs every failed command as error. The Builder in the DefaultCommandGateway class does not offer a way to provide an own logger implementation. Is there some way to use a custom logger implementation without inheriting the class?
Yes, exactly. The idea is, that we have specific commands which are failing in completely normal environment, like a LoginCommand, which fails if the user is locked for example. As we are also using Google Cloud Logging, we want to make sure, that it creates error reports only in case of “real errors”. This is the reason, why we would like to define the log level of failing commands.
Is there a way to configure it?
I can provide you some demo code as soon as possible, if still needed.
Touching base here to share that pull request #2130 will provide a means to replace the default FailureLoggingCallback used within the DefaultCommandGateway.
It’ll be a part of Axon Framework 4.6.0, which will most likely be released somewhere next month.
So, @chrisa50, please give it a try once it’s out!