Open Closed

ABP audit logging in different microservice #2721


User avatar
0
imranStem created

I am working on ABP microservice architecture. I have created a new microservice and added an audit logging package in this microservice and remove the references from the administration microservice. I have followed the document https://docs.abp.io/en/commercial/latest/startup-templates/microservice/add-microservice and successfully added the Logging microservice. I run the migration and audit log-related tables are created in the new Loggin database.

I have also done the below changes on MyProjectSharedHostingModule.

private void ConfigureDatabaseConnections()
        {
            Configure<AbpDbConnectionOptions>(options =>
            {
                options.Databases.Configure("SaasService", database =>
                {
                    database.MappedConnections.Add("Saas");
                    database.IsUsedByTenants = false;
                });
                
                options.Databases.Configure("AdministrationService", database =>
                {
                    database.MappedConnections.Add("AbpPermissionManagement");
                    database.MappedConnections.Add("AbpSettingManagement");
                    database.MappedConnections.Add("AbpFeatureManagement");
                    database.MappedConnections.Add("AbpLanguageManagement");
                    database.MappedConnections.Add("TextTemplateManagement");
                    database.MappedConnections.Add("AbpBlobStoring");
                    database.MappedConnections.Add("Chat");
                });

                options.Databases.Configure("LoggingService", database =>
                {
                    database.MappedConnections.Add("AbpAuditLogging");
                });
                options.Databases.Configure("IdentityService", database =>
                {
                    database.MappedConnections.Add("AbpIdentity");
                    database.MappedConnections.Add("AbpIdentityServer");
                });
            });
        }

and also added the connection string of logging microservices in all other microservices so log inserts into logging service database.

But Logs are not inserted into the Logging database. The audit logs were inserted into the log file but not in the database.

  • ABP Framework version: v5.1.4
  • UI type: Angular
  • DB provider: EF Core
  • Tiered (MVC) or Identity Server Separated (Angular): yes
  • Exception message and stack trace: No Exception
  • Steps to reproduce the issue:" Create new microservice and add audit logging into that microservice with logging database and remove audit login modules from administration microservice.

4 Answer(s)
  • User Avatar
    0
    alper created
    Support Team Director

    we'll reply this asap

  • User Avatar
    0
    imranStem created

    Waiting for the reply.

  • User Avatar
    0
    gterdem created
    Senior .NET Developer

    I have written a guide about how to use a management module as a microservice; using Audit-Logging as the sample.

    Guide should be available today or tomorrow. I will share the guide link.

  • User Avatar
    0
    gterdem created
    Senior .NET Developer

    Extracting a Module as a Microservice guide is now available.

Made with ❤️ on ABP v9.1.0-preview. Updated on November 01, 2024, 05:35