Skip to content

Commit 1fec903

Browse files
committed
Only include detailed HTTP diagnostics in node health output when --verbose is set
1 parent c3421e5 commit 1fec903

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

src/SeqCli/Cli/Commands/Node/HealthCommand.cs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,13 +54,16 @@ protected override async Task<int> Run()
5454
try
5555
{
5656
var response = await connection.Client.HttpClient.GetAsync("health");
57-
Console.WriteLine($"HTTP {response.Version} {((int)response.StatusCode).ToString(CultureInfo.InvariantCulture)} {response.ReasonPhrase}");
57+
Log.Information("HTTP {HttpVersion} {StatusCode} {ReasonPhrase}", response.Version, (int)response.StatusCode, response.ReasonPhrase);
58+
5859
foreach (var (key, values) in response.Headers.Concat(response.Content.Headers))
5960
foreach (var value in values)
6061
{
61-
Console.WriteLine($"{key}: {value}");
62+
Log.Information("{HeaderName}: {HeaderValue}", key, value);
6263
}
64+
6365
Console.WriteLine(await response.Content.ReadAsStringAsync());
66+
6467
return response.IsSuccessStatusCode ? 0 : 1;
6568
}
6669
catch (Exception ex)

0 commit comments

Comments
 (0)