Adds node id to downloaded container logs

This commit is contained in:
benbierens 2023-10-08 08:31:48 +02:00
parent 24ba0b4f09
commit f3555f2703
No known key found for this signature in database
GPG Key ID: FE44815D96D0A1AA
2 changed files with 6 additions and 4 deletions

View File

@ -16,11 +16,11 @@ namespace ContinuousTests
this.log = log;
}
public void Download(LogFile targetFile, RunningContainer container, DateTime startUtc, DateTime endUtc)
public void Download(LogFile targetFile, RunningContainer container, DateTime startUtc, DateTime endUtc, string openingLine)
{
try
{
DownloadLog(targetFile, container, startUtc, endUtc);
DownloadLog(targetFile, container, startUtc, endUtc, openingLine);
}
catch (Exception ex)
{
@ -28,10 +28,11 @@ namespace ContinuousTests
}
}
private void DownloadLog(LogFile targetFile, RunningContainer container, DateTime startUtc, DateTime endUtc)
private void DownloadLog(LogFile targetFile, RunningContainer container, DateTime startUtc, DateTime endUtc, string openingLine)
{
log.Log($"Downloading log (from ElasticSearch) for container '{container.Name}' within time range: " +
$"{startUtc.ToString("o")} - {endUtc.ToString("o")}");
log.Log(openingLine);
var http = CreateElasticSearchHttp();
var queryTemplate = CreateQueryTemplate(container, startUtc, endUtc);

View File

@ -109,7 +109,8 @@ namespace ContinuousTests
foreach (var node in nodes)
{
elasticSearchLogDownloader.Download(fixtureLog.CreateSubfile(), node.Container, effectiveStart, effectiveEnd);
var openingLine = $"{node.Container.Name} = {node.GetDebugInfo().id}";
elasticSearchLogDownloader.Download(fixtureLog.CreateSubfile(), node.Container, effectiveStart, effectiveEnd, openingLine);
}
}