@recaptime-dev's working patches + fork for Phorge, a community fork of Phabricator. (Upstream dev and stable branches are at upstream/main and upstream/stable respectively.) hq.recaptime.dev/wiki/Phorge
phorge phabricator
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Fix Aphlict logging

Summary:
Yeahhhhhhhh....

- Open a "stream", not a "steam".
- Make error easier for users to understand.
- Write to the log in debug mode so the issue is more apparent.

Test Plan:
- Started server with bad permissions, got usable error message.
- Started server with good permissions, got logfile.

Reviewers: joshuaspence, btrahan

Reviewed By: btrahan

Subscribers: Korvin, epriestley

Differential Revision: https://secure.phabricator.com/D11339

+23 -7
+1 -3
src/applications/aphlict/management/PhabricatorAphlictManagementWorkflow.php
··· 136 136 $server_argv[] = '--ssl-cert='.$ssl_cert; 137 137 } 138 138 139 - if (!$this->debug) { 140 - $server_argv[] = '--log='.$log; 141 - } 139 + $server_argv[] = '--log='.$log; 142 140 143 141 if ($this->clientHost) { 144 142 $server_argv[] = '--client-host='.$this->clientHost;
+21 -3
support/aphlict/server/aphlict_server.js
··· 43 43 var config = parse_command_line_arguments(process.argv); 44 44 45 45 process.on('uncaughtException', function(err) { 46 - debug.log('\n<<< UNCAUGHT EXCEPTION! >>>\n' + err.stack); 46 + var context = null; 47 + if ((err.code == 'EACCES') && 48 + (err.path == config.log)) { 49 + context = util.format( 50 + 'Unable to open logfile ("%s"). Check that permissions are set ' + 51 + 'correctly.', 52 + err.path); 53 + } 54 + 55 + var message = [ 56 + '\n<<< UNCAUGHT EXCEPTION! >>>', 57 + ]; 58 + if (context) { 59 + message.push(context); 60 + } 61 + message.push(err.stack); 62 + 63 + debug.log(message.join('\n\n')); 64 + 47 65 process.exit(1); 48 66 }); 49 67 ··· 69 87 } 70 88 71 89 // Add the logfile so we'll fail if we can't write to it. 72 - if (config.logfile) { 73 - debug.addLogfile(config.logfile); 90 + if (config.log) { 91 + debug.addLogfile(config.log); 74 92 } 75 93 76 94 // If we're just doing a configuration test, exit here before starting any
+1 -1
support/aphlict/server/lib/AphlictLog.js
··· 20 20 mode: 066 21 21 }; 22 22 23 - var logfile = fs.createWriteSteam(path, options); 23 + var logfile = fs.createWriteStream(path, options); 24 24 25 25 this._writeToLogs.push(logfile); 26 26