Open Closed

Separate database for AuditLog module in Application #2929


User avatar
0
imranStem created

I created the application from the ABP Suite. I have changed the connection string as per below.

"ConnectionStrings": {
    "Default": "Server=SS-DBS01;Database=AbpApp;Trusted_Connection=True;MultipleActiveResultSets=true",
    "AbpAuditLogging": "Server=SS-DBS01;Database=AbpAppLogs;Trusted_Connection=True;MultipleActiveResultSets=true;TrustServerCertificate=True"
  },`

When I add the migration, the ABP audit log tables are added to the default database. I want a separate database for the ABP audit logs. I have read all the documents as well.

  • ABP Framework version: v4.3.2
  • UI type: Angular
  • DB provider: EF Core
  • Tiered (MVC) or Identity Server Separated (Angular): yes
  • Exception message and stack trace:
  • Steps to reproduce the issue:"
Markdown supported.
Copy, paste, or drag & drop images and files (max 100 MB per file, 100 MB total per post)

1 Answer(s)
  • User Avatar
    0
    liangshiwei created
    Fullstack Developer

    Hi,

    You need a second DbContext to create the database.

    We have an example, you can check it: https://github.com/abpframework/abp-samples/tree/master/EfCoreMigrationDemo

    Markdown supported.
    Copy, paste, or drag & drop images and files (max 100 MB per file, 100 MB total per post)
Boost Your Development
ABP Live Training
Packages
See Trainings
Mastering ABP Framework Book
The Official Guide
Mastering
ABP Framework
Learn More
Mastering ABP Framework Book
Made with ❤️ on ABP v10.8.0-preview. Updated on September 16, 2026, 14:50
1
ABP Assistant
🔐 You need to be logged in to use the chatbot. Please log in first.