abp icon indicating copy to clipboard operation
abp copied to clipboard

Change AuditLog ApplicationName on the go

Open nishadebrahim opened this issue 6 years ago • 2 comments

Hi, As per the Abp.io document, the following code is written in ApiHttpApiHostModule.cs

private void ConfigureAuditLogs() { Configure(options => { options.IsEnabledForGetRequests = true; options.ApplicationName = _appConfiguration["Properties:LegoBlockId"]; options.EntityHistorySelectors.AddAllEntities(); }); }

But i need to change the ApplicationName later as i am getting this from the header in a later time. Is there any way to change it from other class down the line.

Abp.io version 2.9.

abp

nishadebrahim avatar Nov 04 '20 14:11 nishadebrahim

You can try to rewrite the IAuditingHelper to use the dynamic ApplicationName instead of option.ApplicationName

https://github.com/abpframework/abp/blob/1da901ee156d82ade03ecc9aa984a85da884d5dc/framework/src/Volo.Abp.Auditing/Volo/Abp/Auditing/AuditingHelper.cs#L132

maliming avatar Nov 05 '20 01:11 maliming

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

stale[bot] avatar Jan 04 '21 01:01 stale[bot]