- Add Hangfire packages (AspNetCore, Core, InMemory, SqlServer) with configurable storage (InMemory vs SQL Server) - Configure Hangfire dashboard at /hangfire with AllowAllDashboardAuthorizationFilter (no auth for development) - Add Microsoft.Extensions.Hosting.WindowsServices package with conditional UseWindowsService() based on HostingOptions:UseWindowsService config - Create ProfileManager BackgroundService with IServiceScopeFactory for scoped service resolution per iteration - Create AllowAllDashboardAuthorizationFilter for Hangfire dashboard access - Create DtoExtensions with JobId() and ToJob() helper methods - Configure Serilog with file sink (Production: Logs/log-.txt, daily rolling, 30 day retention) and console sink (Development) - Add Serilog enrichers: FromLogContext, WithMachineName, WithThreadId - Update appsettings.json with Hangfire:InMemory flag, HostingOptions:UseWindowsService flag, and Serilog configuration - Create appsettings.Development.json with console-specific Serilog configuration
45 lines
1.1 KiB
JSON
45 lines
1.1 KiB
JSON
{
|
|
"Serilog": {
|
|
"Using": [ "Serilog.Sinks.File" ],
|
|
"MinimumLevel": {
|
|
"Default": "Information",
|
|
"Override": {
|
|
"Microsoft.AspNetCore": "Warning",
|
|
"Microsoft.EntityFrameworkCore": "Warning",
|
|
"Hangfire": "Information"
|
|
}
|
|
},
|
|
"WriteTo": [
|
|
{
|
|
"Name": "File",
|
|
"Args": {
|
|
"path": "Logs/log-.txt",
|
|
"rollingInterval": "Day",
|
|
"outputTemplate": "[{Timestamp:yyyy-MM-dd HH:mm:ss.fff zzz}] [{Level:u3}] {Message:lj}{NewLine}{Exception}",
|
|
"retainedFileCountLimit": 30
|
|
}
|
|
}
|
|
],
|
|
"Enrich": [ "FromLogContext", "WithMachineName", "WithThreadId" ]
|
|
},
|
|
"Logging": {
|
|
"LogLevel": {
|
|
"Default": "Information",
|
|
"Microsoft.AspNetCore": "Warning"
|
|
}
|
|
},
|
|
"ConnectionStrings": {
|
|
"SDD-VMP04-SQL17": "Server=SDD-VMP04-SQL17\\DD_DEVELOP01;Database=DD_ECM;User Id=sa;Password=dd;Encrypt=false;TrustServerCertificate=True;"
|
|
},
|
|
"AllowedHosts": "*",
|
|
"HostingOptions": {
|
|
"UseWindowsService": false
|
|
},
|
|
"Hangfire": {
|
|
"InMemory": true
|
|
},
|
|
"ReC": {
|
|
"ApiUrl": "http://172.24.12.39:90"
|
|
}
|
|
}
|