Skip to content

Commit

Permalink
Debugging
Browse files Browse the repository at this point in the history
  • Loading branch information
sburmanoctopus committed Dec 13, 2023
1 parent 1f0e3da commit 63a33e8
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -478,6 +478,11 @@ public async Task ShouldLogStartupDiagnosticsToInstanceLogFileOnly(TentacleConfi
foreach (var logFile in logFiles)
{
Logger.Error($"Found Log file: {logFile}");

if (logFile.Contains("Debug"))
{
Logger.Error($"Debug Contents:{File.ReadAllText(logFile)}");
}
}

throw;
Expand Down
11 changes: 11 additions & 0 deletions source/Octopus.Tentacle/Startup/AbstractCommand.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
using System.Collections.Generic;
using System.IO;
using System.Linq;
using Octopus.Tentacle.Diagnostics;
using Octopus.Tentacle.Internals.Options;

namespace Octopus.Tentacle.Startup
Expand Down Expand Up @@ -76,6 +77,16 @@ public virtual void Start(string[] commandLineArguments, ICommandRuntime command
LogFileOnlyLogger.Info($"==== {GetType().Name} ====");
LogFileOnlyLogger.Info($"CommandLine: {string.Join(" ", Environment.GetCommandLineArgs())}");

var logDir = OctopusLogsDirectoryRenderer.LogsDirectory;
var instance = Guid.NewGuid().ToString();
var debugFile = Path.Combine(logDir, $"Debug-{instance}.txt");
File.WriteAllLines(debugFile, new []
{
string.Join(" ", Environment.GetCommandLineArgs()),

});


Start();
Completed();
}
Expand Down

0 comments on commit 63a33e8

Please sign in to comment.