From 20a7995d73d8231613d82f1270872581fb4409e6 Mon Sep 17 00:00:00 2001 From: faytranevozter Date: Fri, 27 Dec 2024 01:43:52 +0700 Subject: [PATCH] fix: update docker logs command to conditionally include raw flag for swarm --- apps/dokploy/server/wss/docker-container-logs.ts | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/apps/dokploy/server/wss/docker-container-logs.ts b/apps/dokploy/server/wss/docker-container-logs.ts index 4a89e42b2..092f39735 100644 --- a/apps/dokploy/server/wss/docker-container-logs.ts +++ b/apps/dokploy/server/wss/docker-container-logs.ts @@ -54,7 +54,9 @@ export const setupDockerContainerLogsWebSocketServer = ( const client = new Client(); client .once("ready", () => { - const baseCommand = `docker ${runType === "swarm" ? "service" : "container"} logs --timestamps --tail ${tail} ${ + const baseCommand = `docker ${runType === "swarm" ? "service" : "container"} logs --timestamps ${ + runType === "swarm" ? "--raw" : "" + } --tail ${tail} ${ since === "all" ? "" : `--since ${since}` } --follow ${containerId}`; const escapedSearch = search ? search.replace(/'/g, "'\\''") : ""; @@ -98,7 +100,9 @@ export const setupDockerContainerLogsWebSocketServer = ( }); } else { const shell = getShell(); - const baseCommand = `docker ${runType === "swarm" ? "service" : "container"} logs --timestamps --tail ${tail} ${ + const baseCommand = `docker ${runType === "swarm" ? "service" : "container"} logs --timestamps ${ + runType === "swarm" ? "--raw" : "" + } --tail ${tail} ${ since === "all" ? "" : `--since ${since}` } --follow ${containerId}`; const command = search