Base solution for your next web application
Ends in:
01 DAYS
01 HRS
01 MIN
01 SEC

Activities of "pumbinha"

I made the same question some weeks ago. Now I'm only saving the logs that contain an exception. More info here: [https://forum.aspnetboilerplate.com/viewtopic.php?f=5&t=9467&p=20804&hilit=audit#p20804])

Answer

<cite>ismcagdas: </cite> Hi @pumbinha,

This is not possible by default but you can modify menu cshtml/html file to implement this. I can point you to correct file if you can share the template you are using (angular1, angular2, MVC 5.x & jQuery, ASP.NET Core & jQuery).

Thanks.

Hi, that would be great!

I'm currently using Angular 1.x + MVC5.

Thank you in advance!

I found some examples like here: <a class="postlink" href="https://stackoverflow.com/questions/39811845/angularjs-routing-with-parameters">https://stackoverflow.com/questions/398 ... parameters</a>

but I don't know if this will work with Aspnet zero. In App.js there is no $routeProvider that I can reference :(

Well, I finally found a solution, I leave it here just in case it's useful for someone:

I've created my own AuditingStore class:

public class AuditingStoreExtended : AuditingStore
    {
        public AuditingStoreExtended(IRepository<AuditLog, long> auditLogRepository) : base(auditLogRepository)
        {
        }

        public override Task SaveAsync(AuditInfo auditInfo)
        {
            Task result = Task.FromResult(new AuditLog()); ;

            if (auditInfo.Exception != null)
            {
                result = base.SaveAsync(auditInfo);
            }

            return result;
        }        
    }

After this I injected this new class in XXXCoreModule.cs:

IocManager.Register<IAuditingStore, AuditingStoreExtended>();

And now it works perfectly :)

Is this what you meant?

Thanks!

<cite>pumbinha: </cite> Hi all,

because a lot of traces are being recorded in the audit log I was wondering if it was possible to set some kind of level to save only the traces that generate an exception.

If this is not possible "out of the box", is it possible to extend the audit-log framework to achieve this?

Thank you in advance.

This means, that I can use my own AuditingStoreProvider or should I create a new class that inherits from AuditingStore and there I write my own business logic?

I can't find any place in code where the AuditingStoreProvider is set.

Hi,

I'm currently using version 1.

If it helps, that's what I added in the AppNavigationProvider Class:

).AddItem(new MenuItemDefinition(
                            PageNames.App.Host.Hangfire,
                            L("Hangfire"),
                            url: "/hangfire",
                            icon: "icon-wrench",
                            target:"_blank",
                            requiredPermissionName: AppPermissions.Pages_Administration_HangfireDashboard
                        )
Showing 1 to 7 of 7 entries