summary refs log tree commit diff
path: root/SystemdCtl/Controllers
diff options
context:
space:
mode:
authorRory& <root@rory.gay>2024-01-20 09:19:14 +0100
committerRory& <root@rory.gay>2024-01-20 09:19:14 +0100
commit56ede8db6b1f90facbd3baa2599769f4e9f73013 (patch)
tree49d9c683bc99282e981725f4de91ab9be150ea30 /SystemdCtl/Controllers
parentInitial commit (diff)
downloadSystemdCtl-56ede8db6b1f90facbd3baa2599769f4e9f73013.tar.xz
Json logs
Diffstat (limited to 'SystemdCtl/Controllers')
-rw-r--r--SystemdCtl/Controllers/UnitController.cs6
1 files changed, 3 insertions, 3 deletions
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<string> GetUnitLogs(string serviceName)
+    public async IAsyncEnumerable<SystemdJournalLogItem> 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();
         }
     }