Error Logging in Command Gateway

Hello there,

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?

Thank you very much in advance!

Hi @chrisa50,

We think you are talking about the FailureLoggingCallback, right?
If so, why do you want to configure it and what are you trying to achieve?

Can you share some code snippets of what you are trying to achieve? It would help us to understand the question here.

KR,

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.

Hi @chrisa50, thanks for the explanation.

That’s a good idea and we have drafted up an issue for that, and you can see it here.

If you have time, feel free to contribute to the Framework.
Otherwise, we at AxonIQ should work on that at some point.

KR,

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!