mirror of
https://github.com/Icinga/icingaweb2.git
synced 2025-07-27 07:44:04 +02:00
LoggingConfigForm: on Docker default to webserver log
This commit is contained in:
parent
0031108160
commit
3784fe80b7
@ -30,6 +30,8 @@ class LoggingConfigForm extends Form
|
|||||||
*/
|
*/
|
||||||
public function createElements(array $formData)
|
public function createElements(array $formData)
|
||||||
{
|
{
|
||||||
|
$defaultType = getenv('ICINGAWEB_OFFICIAL_DOCKER_IMAGE') ? 'php' : 'syslog';
|
||||||
|
|
||||||
$this->addElement(
|
$this->addElement(
|
||||||
'select',
|
'select',
|
||||||
'logging_log',
|
'logging_log',
|
||||||
@ -38,6 +40,7 @@ class LoggingConfigForm extends Form
|
|||||||
'autosubmit' => true,
|
'autosubmit' => true,
|
||||||
'label' => $this->translate('Logging Type'),
|
'label' => $this->translate('Logging Type'),
|
||||||
'description' => $this->translate('The type of logging to utilize.'),
|
'description' => $this->translate('The type of logging to utilize.'),
|
||||||
|
'value' => $defaultType,
|
||||||
'multiOptions' => array(
|
'multiOptions' => array(
|
||||||
'syslog' => 'Syslog',
|
'syslog' => 'Syslog',
|
||||||
'php' => $this->translate('Webserver Log', 'app.config.logging.type'),
|
'php' => $this->translate('Webserver Log', 'app.config.logging.type'),
|
||||||
@ -94,7 +97,7 @@ class LoggingConfigForm extends Form
|
|||||||
)
|
)
|
||||||
);
|
);
|
||||||
|
|
||||||
if (! isset($formData['logging_log']) || $formData['logging_log'] === 'syslog') {
|
if ((isset($formData['logging_log']) ? $formData['logging_log'] : $defaultType) === 'syslog') {
|
||||||
if (Platform::isWindows()) {
|
if (Platform::isWindows()) {
|
||||||
/* @see https://secure.php.net/manual/en/function.openlog.php */
|
/* @see https://secure.php.net/manual/en/function.openlog.php */
|
||||||
$this->addElement(
|
$this->addElement(
|
||||||
|
Loading…
x
Reference in New Issue
Block a user