added some parameter checking and error logging

errors written to log, and displayed in terse format.