Enhanced logging to trace down intermittent errors