DDF-97: Revamp of security logging.

Removed some duplicate methods and added in better logging checks so that error messages are more useful.