making basic logging to file thread safe