Configurable exception logging

Re-submittal of #729.

This change will help IT better be able to control if a stack trace is displayed for a failed login attempt.