refactor(logging): adopt ZB.MOM.WW.Telemetry.Serilog bootstrap
Swap the gateway process logging from the default Microsoft.Extensions.Logging provider onto the shared ZB.MOM.WW.Telemetry.Serilog two-stage bootstrap. - Add a cross-repo ProjectReference to ZB.MOM.WW.Telemetry.Serilog (transitively brings the Telemetry core package); the referenced project resolves its own Directory.Build.props / Directory.Packages.props so it does not perturb this build. - Replace MEL wiring in GatewayApplication with builder.AddZbSerilog(ServiceName= "mxgateway"; SiteId/NodeRole read from MxGateway:Telemetry when present) and add app.UseSerilogRequestLogging(). - Add a Serilog section (Console + daily rolling File sinks, MinimumLevel) to appsettings.json and a MinimumLevel override to appsettings.Development.json, replacing the old MEL Logging sections. The net48/x86 worker is untouched. Correlation scope + redaction move to the shared ILogRedactor seam in the follow-up commit.
This commit is contained in:
@@ -1,9 +1,30 @@
|
||||
{
|
||||
"Logging": {
|
||||
"LogLevel": {
|
||||
"Serilog": {
|
||||
"Using": [
|
||||
"Serilog.Sinks.Console",
|
||||
"Serilog.Sinks.File"
|
||||
],
|
||||
"MinimumLevel": {
|
||||
"Default": "Information",
|
||||
"Microsoft.AspNetCore": "Warning"
|
||||
}
|
||||
"Override": {
|
||||
"Microsoft.AspNetCore": "Warning"
|
||||
}
|
||||
},
|
||||
"WriteTo": [
|
||||
{
|
||||
"Name": "Console",
|
||||
"Args": {
|
||||
"outputTemplate": "[{Timestamp:HH:mm:ss} {Level:u3}] [{NodeRole}/{NodeHostname}] {Message:lj} {Properties:j}{NewLine}{Exception}"
|
||||
}
|
||||
},
|
||||
{
|
||||
"Name": "File",
|
||||
"Args": {
|
||||
"path": "logs/mxgateway-.log",
|
||||
"rollingInterval": "Day"
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
"AllowedHosts": "*",
|
||||
"MxGateway": {
|
||||
|
||||
Reference in New Issue
Block a user