From 56ede8db6b1f90facbd3baa2599769f4e9f73013 Mon Sep 17 00:00:00 2001 From: Rory& Date: Sat, 20 Jan 2024 09:19:14 +0100 Subject: Json logs --- SystemdCtl/Controllers/UnitController.cs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'SystemdCtl/Controllers') diff --git a/SystemdCtl/Controllers/UnitController.cs b/SystemdCtl/Controllers/UnitController.cs index 212df7d..00916bf 100644 --- a/SystemdCtl/Controllers/UnitController.cs +++ b/SystemdCtl/Controllers/UnitController.cs @@ -18,11 +18,11 @@ public class UnitController : ControllerBase } [HttpGet("unit/{serviceName}/logs")] - public async IAsyncEnumerable GetUnitLogs(string serviceName) + public async IAsyncEnumerable GetUnitLogs(string serviceName) { - await foreach (var line in CommandExecutor.ExecuteCommandAsync("journalctl", $"-xaefu {serviceName}")) + await foreach (var log in SystemdExecutor.GetUnitLogs(serviceName)) { - yield return line; + yield return log; await Response.Body.FlushAsync(); } } -- cgit 1.5.1