Page MenuHomePhabricator

D10385.id25000.diff
No OneTemporary

D10385.id25000.diff

diff --git a/src/applications/daemon/management/PhabricatorDaemonManagementLogWorkflow.php b/src/applications/daemon/management/PhabricatorDaemonManagementLogWorkflow.php
--- a/src/applications/daemon/management/PhabricatorDaemonManagementLogWorkflow.php
+++ b/src/applications/daemon/management/PhabricatorDaemonManagementLogWorkflow.php
@@ -52,9 +52,14 @@
}
$console = PhutilConsole::getConsole();
+
+ $limit = $args->getArg('limit');
+
$logs = id(new PhabricatorDaemonLogEvent())->loadAllWhere(
- 'logID IN (%Ld) ORDER BY id ASC',
- mpull($daemons, 'getID'));
+ 'logID IN (%Ld) ORDER BY id DESC LIMIT %d',
+ mpull($daemons, 'getID'),
+ $limit);
+ $logs = array_reverse($logs);
$lines = array();
foreach ($logs as $log) {
@@ -69,6 +74,11 @@
}
}
+ // Each log message may be several lines. Limit the number of lines we
+ // output so that `--limit 123` means "show 123 lines", which is the most
+ // easily understandable behavior.
+ $lines = array_slice($lines, -$limit);
+
foreach ($lines as $line) {
$id = $line['id'];
$type = $line['type'];

File Metadata

Mime Type
text/plain
Expires
Oct 10 2025, 12:36 PM (17 w, 4 d ago)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
8619553
Default Alt Text
D10385.id25000.diff (1 KB)

Event Timeline