4bf71a0b2c
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.
102 lines
2.8 KiB
JSON
102 lines
2.8 KiB
JSON
{
|
|
"Serilog": {
|
|
"Using": [
|
|
"Serilog.Sinks.Console",
|
|
"Serilog.Sinks.File"
|
|
],
|
|
"MinimumLevel": {
|
|
"Default": "Information",
|
|
"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": {
|
|
"Authentication": {
|
|
"Mode": "ApiKey",
|
|
"SqlitePath": "C:\\ProgramData\\MxGateway\\gateway-auth.db",
|
|
"PepperSecretName": "MxGateway:ApiKeyPepper",
|
|
"RunMigrationsOnStartup": true
|
|
},
|
|
"Ldap": {
|
|
"Enabled": true,
|
|
"Server": "localhost",
|
|
"Port": 3893,
|
|
"UseTls": false,
|
|
"AllowInsecureLdap": true,
|
|
"SearchBase": "dc=lmxopcua,dc=local",
|
|
"ServiceAccountDn": "cn=serviceaccount,dc=lmxopcua,dc=local",
|
|
"ServiceAccountPassword": "serviceaccount123",
|
|
"UserNameAttribute": "cn",
|
|
"DisplayNameAttribute": "cn",
|
|
"GroupAttribute": "memberOf"
|
|
},
|
|
"Worker": {
|
|
"ExecutablePath": "src\\ZB.MOM.WW.MxGateway.Worker\\bin\\x86\\Release\\ZB.MOM.WW.MxGateway.Worker.exe",
|
|
"RequiredArchitecture": "X86",
|
|
"StartupTimeoutSeconds": 30,
|
|
"ShutdownTimeoutSeconds": 10,
|
|
"HeartbeatIntervalSeconds": 5,
|
|
"HeartbeatGraceSeconds": 15,
|
|
"MaxMessageBytes": 16777216
|
|
},
|
|
"Sessions": {
|
|
"DefaultCommandTimeoutSeconds": 30,
|
|
"MaxSessions": 64,
|
|
"MaxPendingCommandsPerSession": 128,
|
|
"DefaultLeaseSeconds": 1800,
|
|
"LeaseSweepIntervalSeconds": 30,
|
|
"AllowMultipleEventSubscribers": false
|
|
},
|
|
"Events": {
|
|
"QueueCapacity": 10000,
|
|
"BackpressurePolicy": "FailFast"
|
|
},
|
|
"Dashboard": {
|
|
"Enabled": true,
|
|
"AllowAnonymousLocalhost": true,
|
|
"SnapshotIntervalMilliseconds": 1000,
|
|
"RecentFaultLimit": 100,
|
|
"RecentSessionLimit": 200,
|
|
"ShowTagValues": false,
|
|
"GroupToRole": {
|
|
"GwAdmin": "Admin",
|
|
"GwReader": "Viewer"
|
|
}
|
|
},
|
|
"Protocol": {
|
|
"WorkerProtocolVersion": 1,
|
|
"MaxGrpcMessageBytes": 16777216
|
|
},
|
|
"Galaxy": {
|
|
"ConnectionString": "Server=localhost;Database=ZB;Integrated Security=True;TrustServerCertificate=True;Encrypt=False;",
|
|
"CommandTimeoutSeconds": 60,
|
|
"DashboardRefreshIntervalSeconds": 30,
|
|
"PersistSnapshot": true,
|
|
"SnapshotCachePath": "C:\\ProgramData\\MxGateway\\galaxy-snapshot.json"
|
|
},
|
|
"Alarms": {
|
|
"Enabled": true,
|
|
"SubscriptionExpression": "\\\\DESKTOP-6JL3KKO\\Galaxy!DEV",
|
|
"DefaultArea": "",
|
|
"ReconcileIntervalSeconds": 30
|
|
}
|
|
}
|
|
}
|