Changeset View
Changeset View
Standalone View
Standalone View
src/applications/config/option/PhabricatorAccessLogConfigOptions.php
Show First 20 Lines • Show All 67 Lines • ▼ Show 20 Lines | public function getOptions() { | ||||
$ssh_desc .= $this->renderMapHelp($ssh_map); | $ssh_desc .= $this->renderMapHelp($ssh_map); | ||||
return array( | return array( | ||||
$this->newOption('log.access.path', 'string', null) | $this->newOption('log.access.path', 'string', null) | ||||
->setLocked(true) | ->setLocked(true) | ||||
->setSummary(pht('Access log location.')) | ->setSummary(pht('Access log location.')) | ||||
->setDescription( | ->setDescription( | ||||
pht( | pht( | ||||
"To enable the Phabricator access log, specify a path. The ". | "To enable the HTTP access log, specify a path. This log is ". | ||||
"Phabricator access than normal HTTP access logs (for instance, ". | "more detailed than normal HTTP access logs (for instance, ". | ||||
"it can show logged-in users, controllers, and other application ". | "it can show logged-in users, controllers, and other application ". | ||||
"data).\n\n". | "data).\n\n". | ||||
"If not set, no log will be written.")) | "If not set, no log will be written.")) | ||||
->addExample( | ->addExample( | ||||
null, | null, | ||||
pht('Disable access log.')) | pht('Disable access log.')) | ||||
->addExample( | ->addExample( | ||||
'/var/log/phabricator/access.log', | '/var/log/devtools/access.log', | ||||
pht('Write access log here.')), | pht('Write access log here.')), | ||||
$this->newOption( | $this->newOption( | ||||
'log.access.format', | 'log.access.format', | ||||
// NOTE: This is 'wild' intead of 'string' so "\t" and such can be | // NOTE: This is 'wild' intead of 'string' so "\t" and such can be | ||||
// specified. | // specified. | ||||
'wild', | 'wild', | ||||
"[%D]\t%p\t%h\t%r\t%u\t%C\t%m\t%U\t%R\t%c\t%T") | "[%D]\t%p\t%h\t%r\t%u\t%C\t%m\t%U\t%R\t%c\t%T") | ||||
->setLocked(true) | ->setLocked(true) | ||||
->setSummary(pht('Access log format.')) | ->setSummary(pht('Access log format.')) | ||||
->setDescription($http_desc), | ->setDescription($http_desc), | ||||
$this->newOption('log.ssh.path', 'string', null) | $this->newOption('log.ssh.path', 'string', null) | ||||
->setLocked(true) | ->setLocked(true) | ||||
->setSummary(pht('SSH log location.')) | ->setSummary(pht('SSH log location.')) | ||||
->setDescription( | ->setDescription( | ||||
pht( | pht( | ||||
"To enable the Phabricator SSH log, specify a path. The ". | "To enable the SSH log, specify a path. This log can provide ". | ||||
"access log can provide more detailed information about SSH ". | "more detailed information about SSH access than a normal SSH ". | ||||
"access than a normal SSH log (for instance, it can show ". | "log (for instance, it can show logged-in users, commands, and ". | ||||
"logged-in users, commands, and other application data).\n\n". | "other application data).\n\n". | ||||
"If not set, no log will be written.")) | "If not set, no log will be written.")) | ||||
->addExample( | ->addExample( | ||||
null, | null, | ||||
pht('Disable SSH log.')) | pht('Disable SSH log.')) | ||||
->addExample( | ->addExample( | ||||
'/var/log/phabricator/ssh.log', | '/var/log/devtools/ssh.log', | ||||
pht('Write SSH log here.')), | pht('Write SSH log here.')), | ||||
$this->newOption( | $this->newOption( | ||||
'log.ssh.format', | 'log.ssh.format', | ||||
'wild', | 'wild', | ||||
"[%D]\t%p\t%h\t%r\t%s\t%S\t%u\t%C\t%U\t%c\t%T\t%i\t%o") | "[%D]\t%p\t%h\t%r\t%s\t%S\t%u\t%C\t%U\t%c\t%T\t%i\t%o") | ||||
->setLocked(true) | ->setLocked(true) | ||||
->setSummary(pht('SSH log format.')) | ->setSummary(pht('SSH log format.')) | ||||
->setDescription($ssh_desc), | ->setDescription($ssh_desc), | ||||
$this->newOption('log.ssh-error.path', 'string', null) | $this->newOption('log.ssh-error.path', 'string', null) | ||||
->setLocked(true) | ->setLocked(true) | ||||
->setSummary(pht('SSH error log location.')) | ->setSummary(pht('SSH error log location.')) | ||||
->setDescription( | ->setDescription( | ||||
pht( | pht( | ||||
'To enable the Phabricator SSH error log, specify a path. Errors '. | 'To enable the SSH error log, specify a path. Errors occurring '. | ||||
'occurring in contexts where Phabricator is serving SSH requests '. | 'in contexts where this software is serving SSH requests '. | ||||
'will be written to this log.'. | 'will be written to this log.'. | ||||
"\n\n". | "\n\n". | ||||
'If not set, no log will be written.')) | 'If not set, no log will be written.')) | ||||
->addExample(null, pht('Disable SSH error log.')) | ->addExample(null, pht('Disable SSH error log.')) | ||||
->addExample( | ->addExample( | ||||
'/var/log/phabricator/ssh-error.log', | '/var/log/devtools/ssh-error.log', | ||||
pht('Write SSH error log here.')), | pht('Write SSH error log here.')), | ||||
); | ); | ||||
} | } | ||||
private function renderMapHelp(array $map) { | private function renderMapHelp(array $map) { | ||||
$desc = ''; | $desc = ''; | ||||
foreach ($map as $key => $kdesc) { | foreach ($map as $key => $kdesc) { | ||||
$desc .= " - `%".$key."` ".$kdesc."\n"; | $desc .= " - `%".$key."` ".$kdesc."\n"; | ||||
Show All 15 Lines |