Add logging to file and error emails to admins.
Fix silly mistake with variable name.
Oops...apparently I shouldn't code while tired.
Logs should be in app directory.
Merge branch 'development'