[Web] add crontasks logs

This commit is contained in:
FreddleSpl0it
2023-07-06 15:53:33 +02:00
parent 4613d00a9d
commit 4426bd3d04
4 changed files with 111 additions and 1 deletions

View File

@@ -2367,6 +2367,20 @@ function get_logs($application, $lines = false) {
return $data_array;
}
}
if ($application == "cron-mailcow") {
if (isset($from) && isset($to)) {
$data = $redis->lRange('CRON_LOG', $from - 1, $to - 1);
}
else {
$data = $redis->lRange('CRON_LOG', 0, $lines);
}
if ($data) {
foreach ($data as $json_line) {
$data_array[] = json_decode($json_line, true);
}
return $data_array;
}
}
if ($application == "postfix-mailcow") {
if (isset($from) && isset($to)) {
$data = $redis->lRange('POSTFIX_MAILLOG', $from - 1, $to - 1);