Better log messages when required property is missing, de-duplicating some code.