Add some useful logging for tracking thread matching problems.