Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Consider to save audit logs even if no action performed in the request #2820

Closed
hikalkan opened this issue Feb 13, 2020 · 3 comments · Fixed by #2959
Closed

Consider to save audit logs even if no action performed in the request #2820

hikalkan opened this issue Feb 13, 2020 · 3 comments · Fixed by #2959

Comments

@hikalkan
Copy link
Member

if (!auditLog.Actions.Any() && !auditLog.EntityChanges.Any())
{
return false;
}

It doesn't save if no action or entity changes in the current request.

@hikalkan
Copy link
Member Author

@maliming can you work on that (I don't remember why I did this, but probably not needed to check this)

@maliming
Copy link
Member

Consider this situation.

using (var scope = _auditingManager.BeginScope())
{
	await scope.SaveAsync();
}

Is auditing meaningless if there is no action or entity change?

@hikalkan
Copy link
Member Author

hikalkan commented Mar 3, 2020

Is auditing meaningless if there is no action or entity change?

I think we should still save since the developer wanted it 😄

At least it saves information about the current web request.

Normally, this is intended to be used by the framework in one place (AbpAuditingMiddleware) and no where else.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants