Logging format of warning warn_recovery_failedtorecover is strange or maybe better to say wrong. It looks:
This message came from XAResourceRecord.xaRecoverySecondPass and it's message warn_recovery_failedtorecover. The code with dolar sign seems to me a bit confusing.
I think it would be better first not have the dolar sign there and second rather to print string representation of the error code.