minor lock improvement in logger.cs