Fix botched up logging and add logging call to legacy factory