add option to log application error's

also get the tests working again