Issue 2793 log login failures

Need to merge with master and master-2.3