Record thread id in each message