tracker-enabled-dbcontext icon indicating copy to clipboard operation
tracker-enabled-dbcontext copied to clipboard

AuditLogDetails localization issues

Open talmroth opened this issue 8 years ago • 2 comments

I have a multi-tenant and multi-culture web application. Dates and decimals are converted to string in the ChangeLogDetailsAuditor class.

So if the application is set to fr-CA a decimal will be stored in NewValue and OriginalValue as 10,2 and a DateTime as 2016-03-02 15:07:05. For en-CA those same values would be 10.2 and 2016-03-02 15:07:05.

I see 2 possible solutions for this. Log the culture in the AuditLog or have an optional global setting to use when calling ToString() to have a consistent culture applied to the entire log. Both suffer from the fact that the logs themselves don't contain the data type so an application to view the changes would probably suffer.

I submitted a pull request to make the models partial classes so I can probably implement the second solution with an extended model and update the culture in the log event. However I can see an argument to log in a consistent manner despite the UI culture.

talmroth avatar Mar 02 '16 23:03 talmroth

what about having the EventDateUTC columns as datetimeoffset

dominusbelial avatar May 23 '16 15:05 dominusbelial

It was datetime offset. But i changed it to datetime. Coz datetime offset is not supported databases except for mssql.

bilal-fazlani avatar May 23 '16 18:05 bilal-fazlani