Ends in:
2 DAYS
4 HRS
21 MIN
12 SEC
Ends in:
2 D
4 H
21 M
12 S
Open Closed

Audit tables not show all method events #4413


User avatar
0
christophe.baille created
  • ABP Framework version: v7.0.0
  • UI type: Blazor
  • DB provider: EF Core
  • Tiered (MVC) or Identity Server Separated (Angular): no

On which criteria methods are added on the audit or not?

From the doc here, it seems that by default all methods write to the log table

https://docs.abp.io/en/abp/latest/Audit-Logging

In my solution, I have the issue that most of my methods do not write on the table.

It is well setup, I have "UseAuditing()" on my module and all should be ok, for example, the /Account/Login is logged all the time. But most of other methods from my application services do not appears but they should if I did not add "[DisableAuditing]" right?

Something even more strange, I have a method that run any times I login to build my menu, when login as admin it write on the log table, but if log with another account it doesn't...

Any explanation about how to add all methods to this audit tables?

To try to understand on how logs works, I did this:

1- Create a new Blazor server solution and add an entity 2- Open the entity view, add item, edit it, delete it 3- Open audit log table

I can see that the methods Create, Delete and Get write on the log table, but I have nothing about GetList and Update.

Why GetList and Update are not in log tables if others are? I did nothing appart of buiding from template, is there anything wrong on ABP or something else not documented should be done?

Thanks


6 Answer(s)
  • User Avatar
    0
    maliming created
    Support Team Fullstack Developer

    hi

    1- Create a new Blazor server solution and add an entity 2- Open the entity view, add item, edit it, delete it 3- Open audit log table

    Can you share the project with me? liming.ma@volosoft.com

  • User Avatar
    0
    christophe.baille created

    I just shared it from Github

  • User Avatar
    0
    maliming created
    Support Team Fullstack Developer

    ok, I will check it.

  • User Avatar
    0
    maliming created
    Support Team Fullstack Developer

    hi

    Due to the limitations of Blazor Server, there is currently no workaround

    https://github.com/dotnet/aspnetcore/issues/30115

  • User Avatar
    0
    christophe.baille created

    I am not sure to understand, audit is done from appservice methods, so it should not matter if the method is called from Blazor or anything else right?

    Give more explanation about it please.

    My main issue is this:

    But most of other methods from my application services do not appears but they should if I did not add "[DisableAuditing]" right?

    Something even more strange, I have a method that run any times I login to build my menu, when login as admin it write on the log table, but if log with another account it doesn't...

  • User Avatar
    0
    maliming created
    Support Team Fullstack Developer

    hi

    app.UseAuditing();
    

    The main reason is that the audit log middleware is designed for http requests. Blazor Server's signlar is an event model.

    You can set IsEnabledForGetRequests=true see more logs.

Made with ❤️ on ABP v9.1.0-preview. Updated on December 02, 2024, 12:35