I have developed a SharePoint application with custom login page using form based authentication and Active directiory

Now I want to log the failed login attempt in the application as well as who is login in the system.

Plase help.


We can use SPDiagnosticsService.Local.WriteTrace method to add log to ULS log in custom login page.

In order to make ULS logging work for a AppPool account that is not Administrator, you have to add your AppPool user to "Performance Log Users" group.


How to write custom logs into ULS logs

Write to ULS Logs Programmatically

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.