parameterize logging statements.
Fix logging statements: exception needs to be the last argument.