"this is not possible with the known methods right now" says Microsoft developer. See this comment https://github.com/dotnet/aspnetcore/issues/37728#issuecomment-948511840
We do not need the IP addresses.
We just need something to be able to use the auditlogs. E.g. the app-service name that was called. There needs to be something that can be used for filtering.
ip address from http. Example from blazor serv
Hi, How did you achive this on blazor server?
Ok, thank you for your support.
For anyone else looking for an answer:
ABP Settings does not really work with IOptions.
We went with a hybrid approach that limits ABP to just storing the settings in the DB and created our own small IOptions alternative that is changeable after startup. Actually a very simple approach.
So how is the ABP approach to change settings in the UI?
Do we really have to remove iOptions and add the complete ABP settings module everywhere across the application? This seems like it will cause performance issues (e.g. in each single middlewares that gets started for each call it then has to get the settingsmanager and call the db?)
Also the biggest issues - there is no more datamodel for the options? Having to get string keys is really bad in contrast to accessing a simple DTO.
Ok this solutions is not fixing the 2 main issues:
We do NOT want to have to update the settings when using them in any feature. So in this case, putting OverrideOptionsAsync before getting from the feature:
{
await _options2.As<MySpecialSettings2OptionsManager>().OverrideOptionsAsync();
return _exampleFeature.getSetting();
}
is doing exactly the same thing as with the previous
await _mySpecialSettings2Options.SetAsync();
Both update the CURRENT ioptions instance. For this, the created tmp cache stuff was not necessary - ABP aready provides a feature that does this (AbpDynamicOptionsManager<MySpecialSettings2> + ioptions.SetAsync)
We have 1 place where we update the settings and hundres where we use them - and we of course only want to call the ioptions/abpsettings sync once.
So what does not work:
I will create one and send it to you
What exactly will context.Services.TryAdd(ServiceDescriptor.Singleton(typeof(IOptions<>), typeof(OptionsManager<>)));
do?
My question was on how to get the Settings from ISettingManager into IOptions, permanently?
If i update ISettingManager & restart the app, IOptions is still loaded from the JSON file. How can iOptions be changed to use the ABP settings instead?
With the line added, iOption is still the values from the json file.
await _options.SetAsync();
, which is calling the AbpDynamicOptionsManager
mapping is only updating the current instance of ioptinos, and not the ones injected into the modules.
Please do not close :). I'm watching this issue, as the Audit Logs feature should be fully supported also on Blazor. Currently its nearly useless as filtering is not possible.
I dont think that is should be limited to the request path, there just should be something logged that make the log useful. E.g. The ApplicationService Name. In the current state the feature is really hard to use with blazor server (0 filtering possibility...).
Great, that works!
I updated your solution to include the original part where it formats the JSON, only incase of an invalid json I just display the string.
Thank you!