Base solution for your next web application
Open Closed

AuditLog - LogIn Sometimes Does Not Record UserName #9785


User avatar
0
BigCDogCrew created

AspNetZero v7.2, MVC, jQuery

Often (but not always), the username is not recorded in the AuditLog during login. It seems to work reliably during logout. Also, it does not appear to record the tenant in either case. I have looked, but can not see in the code where the AuditLog is being written. I have also tried to force a few SaveChanges() on the current UnitOfWorkManager in various places to see if I could figure out if the log is being written by ABP dlls; but I was unsuccessful. Where is this happening? How can I add more information to the AuditLog record before it is written?


3 Answer(s)
  • User Avatar
    0
    ismcagdas created
    Support Team

    Hi,

    UserId of an AuditLog is set here. Is it possible that the session is expired ?

  • User Avatar
    0
    BigCDogCrew created

    The AuditingHelper class does not appear in my codebase. Is it something that I need to override?

  • User Avatar
    0
    maliming created
    Support Team

    hi, In the Login method, the user name cannot be get, because the login request has not yet ended.

    You may be redirect to the Login page when you have successfully logged in, the audit log will get the user name, but this user name is the current user instead of user entered UserName.