fix logging in server thread