Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F15334170
D15782.id38021.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
1 KB
Referenced Files
None
Subscribers
None
D15782.id38021.diff
View Options
diff --git a/src/applications/aphlict/management/PhabricatorAphlictManagementWorkflow.php b/src/applications/aphlict/management/PhabricatorAphlictManagementWorkflow.php
--- a/src/applications/aphlict/management/PhabricatorAphlictManagementWorkflow.php
+++ b/src/applications/aphlict/management/PhabricatorAphlictManagementWorkflow.php
@@ -428,6 +428,15 @@
$console = PhutilConsole::getConsole();
$this->willLaunch();
+ $log = $this->getOverseerLogPath();
+ if ($log !== null) {
+ echo tsprintf(
+ "%s\n",
+ pht(
+ 'Writing logs to: %s',
+ $log));
+ }
+
$pid = pcntl_fork();
if ($pid < 0) {
throw new Exception(
@@ -439,6 +448,12 @@
exit(0);
}
+ // Redirect process errors to the error log. If we do not do this, any
+ // error the `aphlict` process itself encounters vanishes into thin air.
+ if ($log !== null) {
+ ini_set('error_log', $log);
+ }
+
// When we fork, the child process will inherit its parent's set of open
// file descriptors. If the parent process of bin/aphlict is waiting for
// bin/aphlict's file descriptors to close, it will be stuck waiting on
@@ -529,4 +544,15 @@
$server_argv);
}
+ private function getOverseerLogPath() {
+ // For now, just return the first log. We could refine this eventually.
+ $logs = idx($this->configData, 'logs', array());
+
+ foreach ($logs as $log) {
+ return $log['path'];
+ }
+
+ return null;
+ }
+
}
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sun, Mar 9, 7:19 AM (4 w, 1 d ago)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
7387318
Default Alt Text
D15782.id38021.diff (1 KB)
Attached To
Mode
D15782: Send the `aphlict` process log to the `node` log
Attached
Detach File
Event Timeline
Log In to Comment