Actually enable node request logging in swarm mode

This commit is contained in:
Dominion
2023-05-17 23:10:38 -04:00
parent e4debac5bc
commit 39692bec2c
2 changed files with 8 additions and 2 deletions
@@ -435,7 +435,10 @@ namespace Tgstation.Server.Host.Core
});
// setup the HTTP request pipeline
// Final point where we wrap exceptions in a 500 (ErrorMessage) response
// Add additional logging context to the request
applicationBuilder.UseAdditionalRequestLoggingContext(swarmConfiguration);
// Wrap exceptions in a 500 (ErrorMessage) response
applicationBuilder.UseServerErrorHandling();
// Add the X-Powered-By response header
@@ -14,6 +14,7 @@ using Tgstation.Server.Api.Models;
using Tgstation.Server.Host;
using Tgstation.Server.Host.Configuration;
using Tgstation.Server.Host.Core;
using Tgstation.Server.Host.Extensions;
using Tgstation.Server.Host.Setup;
using Tgstation.Server.Host.Utils;
@@ -189,7 +190,9 @@ namespace Tgstation.Server.Tests.Live
if (firstRun)
args[0] = string.Format(CultureInfo.InvariantCulture, "Database:DropDatabase={0}", false);
using (swarmNodeId != null
var swarmMode = swarmNodeId != null;
ApplicationBuilderExtensions.LogSwarmIdentifier = swarmMode;
using (swarmMode
? LogContext.PushProperty(SerilogContextHelper.SwarmIdentifierContextProperty, swarmNodeId)
: null)
await RealServer.Run(cancellationToken);