[icinga-checkins] icinga.org: icingaweb2/feature/ allow-to-configure-the-syslog-facility-11214: Store available Syslog facilities non-redundandly

git at icinga.org git at icinga.org
Mon Oct 24 10:56:13 CEST 2016


Module: icingaweb2
Branch: feature/allow-to-configure-the-syslog-facility-11214
Commit: 893daf3a7bf98203c6b7c3f0a96e10c4d2601a0e
URL:    https://git.icinga.org/?p=icingaweb2.git;a=commit;h=893daf3a7bf98203c6b7c3f0a96e10c4d2601a0e

Author: Alexander A. Klimov <alexander.klimov at icinga.com>
Date:   Mon Oct 24 10:55:15 2016 +0200

Store available Syslog facilities non-redundandly

refs #11214

---

 application/forms/Config/General/LoggingConfigForm.php |   14 +++-----------
 1 file changed, 3 insertions(+), 11 deletions(-)

diff --git a/application/forms/Config/General/LoggingConfigForm.php b/application/forms/Config/General/LoggingConfigForm.php
index 428e5a7..5f1b27a 100644
--- a/application/forms/Config/General/LoggingConfigForm.php
+++ b/application/forms/Config/General/LoggingConfigForm.php
@@ -4,6 +4,7 @@
 namespace Icinga\Forms\Config\General;
 
 use Icinga\Application\Logger;
+use Icinga\Application\Logger\Writer\SyslogWriter;
 use Icinga\Application\Platform;
 use Icinga\Web\Form;
 
@@ -103,6 +104,7 @@ class LoggingConfigForm extends Form
                     )
                 );
             } else {
+                $facilities = array_keys(SyslogWriter::$facilities);
                 $this->addElement(
                     'select',
                     'logging_facility',
@@ -111,17 +113,7 @@ class LoggingConfigForm extends Form
                         'label'         => $this->translate('Facility'),
                         'description'   => $this->translate('The syslog facility to utilize.'),
                         'value'         => 'user',
-                        'multiOptions'  => array(
-                            'user'      => 'LOG_USER',
-                            'local0'    => 'LOG_LOCAL0',
-                            'local1'    => 'LOG_LOCAL1',
-                            'local2'    => 'LOG_LOCAL2',
-                            'local3'    => 'LOG_LOCAL3',
-                            'local4'    => 'LOG_LOCAL4',
-                            'local5'    => 'LOG_LOCAL5',
-                            'local6'    => 'LOG_LOCAL6',
-                            'local7'    => 'LOG_LOCAL7'
-                        )
+                        'multiOptions'  => array_combine($facilities, $facilities)
                     )
                 );
             }



More information about the icinga-checkins mailing list