changed synchronized log output from rdbuf() to str()