Skip to content

Commit 3967fba

Browse files
committed
fix: enhance logging by encoding array and object data in clientDebug function
1 parent 96852dc commit 3967fba

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

source/compose.manager/php/util.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,9 @@ function clientDebug($message, $data = null, $type = 'daemon', $level = 'info')
4040
return;
4141
}
4242
if ($data !== null && $data !== '' && $data !== 'null') {
43+
if (is_array($data) || is_object($data)) {
44+
$data = json_encode($data);
45+
}
4346
exec("logger -t 'compose.manager' -p '$logLevel' " . escapeshellarg($message) . ' - Data: ' . escapeshellarg($data));
4447
} else {
4548
exec("logger -t 'compose.manager' -p '$logLevel' " . escapeshellarg($message));

0 commit comments

Comments
 (0)