fix(docker): redirect stderr to stdout for container log retrieval to capture error messages
This commit is contained in:
@@ -1093,11 +1093,11 @@ function getContainerLogs(Server $server, string $container_id, int $lines = 100
|
|||||||
{
|
{
|
||||||
if ($server->isSwarm()) {
|
if ($server->isSwarm()) {
|
||||||
$output = instant_remote_process([
|
$output = instant_remote_process([
|
||||||
"docker service logs -n {$lines} {$container_id}",
|
"docker service logs -n {$lines} {$container_id} 2>&1",
|
||||||
], $server);
|
], $server);
|
||||||
} else {
|
} else {
|
||||||
$output = instant_remote_process([
|
$output = instant_remote_process([
|
||||||
"docker logs -n {$lines} {$container_id}",
|
"docker logs -n {$lines} {$container_id} 2>&1",
|
||||||
], $server);
|
], $server);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1105,7 +1105,6 @@ function getContainerLogs(Server $server, string $container_id, int $lines = 100
|
|||||||
|
|
||||||
return $output;
|
return $output;
|
||||||
}
|
}
|
||||||
|
|
||||||
function escapeEnvVariables($value)
|
function escapeEnvVariables($value)
|
||||||
{
|
{
|
||||||
$search = ['\\', "\r", "\t", "\x0", '"', "'"];
|
$search = ['\\', "\r", "\t", "\x0", '"', "'"];
|
||||||
|
Reference in New Issue
Block a user