Sorry if it is a stupid idea, but cannot you log all messages to a separate file for each test (or attach test id to the messages)? Then if the test fails, you can see where the error occured.
I know there are solutions for this, but in the real world I have not seen it properly implemented.
I am curious, what were implementation issues you have encountered?