I’m just reading the windows username (DOMAIN\username) from HttpContext.Current.User.Identity.Name. I’m hesitant to start coding the LDAP queries for the reasons stated by Wraith in his article: “Utilizing DirectoryEntry-style access is slow and cumbersome when you’re dealing with multiple users, especially when your goal is simply read-only access. Plus, remembering all the different parameters to use can be difficult when you’re trying to write a quick program to solve something, and not a several-month project.”
I would log the username, some other ID that could be generated by the system, and a timestamp.
And then everything else you want to store.
It takes constant time to derive (retrieve) these values so it’s not bad programming practice.