setup log handlers per thread