Skip to content

Commit 6c47c69

Browse files
committed
show more lines for mail and lets encrypt log
1 parent db6ae66 commit 6c47c69

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

server/lib/classes/cron.d/100-monitor_letsencrypt_log.inc.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ public function onRunJob() {
6565
$type = 'log_letsencrypt';
6666

6767
/* Get the data of the log */
68-
$data = $this->_tools->_getLogData($type);
68+
$data = $this->_tools->_getLogData($type, 500);
6969

7070
/*
7171
* actually this info has no state.

server/lib/classes/cron.d/100-monitor_mail_log.inc.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ public function onRunJob() {
6767
$type = 'log_mail';
6868

6969
/* Get the data of the log */
70-
$data = $this->_tools->_getLogData($type);
70+
$data = $this->_tools->_getLogData($type, 500);
7171

7272
/*
7373
* actually this info has no state.

server/lib/classes/monitor_tools.inc.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -488,7 +488,7 @@ public function monitorServices() {
488488
return $res;
489489
}
490490

491-
public function _getLogData($log) {
491+
public function _getLogData($log, $max_lines = 100) {
492492
global $conf;
493493

494494
$dist = '';
@@ -645,7 +645,7 @@ public function _getLogData($log) {
645645
} else {
646646
$log = '';
647647
if (is_readable($logfile)) {
648-
$fd = popen('tail -n 100 ' . escapeshellarg($logfile), 'r');
648+
$fd = popen('tail -n '.intval($max_lines).' ' . escapeshellarg($logfile), 'r');
649649
if ($fd) {
650650
while (!feof($fd)) {
651651
$log .= fgets($fd, 4096);

0 commit comments

Comments
 (0)