Support logging messages by thread