Skip to content

Commit 1051df8

Browse files
committed
Escape slashes on id of message
Fixes #4654
1 parent df80712 commit 1051df8

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

src/ServiceControl/Operations/ErrorIngestionFaultPolicy.cs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,12 @@
77
using System.Runtime.Versioning;
88
using System.Threading;
99
using System.Threading.Tasks;
10+
using Configuration;
11+
using Infrastructure;
1012
using NServiceBus.Logging;
1113
using NServiceBus.Transport;
14+
using Persistence;
1215
using ServiceBus.Management.Infrastructure.Installers;
13-
using ServiceControl.Configuration;
14-
using ServiceControl.Infrastructure;
15-
using ServiceControl.Persistence;
1616

1717
class ErrorIngestionFaultPolicy
1818
{
@@ -79,12 +79,12 @@ async Task DoLogging(Exception exception, FailedErrorImport failure, Cancellatio
7979
if (!AppEnvironment.RunningInContainer)
8080
{
8181
// Write to Log Path
82-
var filePath = Path.Combine(logPath, $"{failure.Id}.txt");
82+
string filePath = Path.Combine(logPath, $"{failure.Id.Replace("/", "_")}.txt");
8383
await File.WriteAllTextAsync(filePath, failure.ExceptionInfo, cancellationToken);
8484

8585
if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows))
8686
{
87-
WriteToEventLog("A message import has failed. A log file has been written to " + filePath);
87+
WriteToEventLog($"A message import has failed. A log file has been written to {filePath}");
8888
}
8989
}
9090
}

0 commit comments

Comments
 (0)