24.6. Enabling the oVirt Engine Extension Logger log4j
24.6. Enabling the oVirt Engine Extension Logger log4j Logger implementation requires the ovirt-engine-extension-logger-log4j package. With the implementation, Red Had Virtualization Manager delegates records into log4j. Log4j is a customizable framework that provides appenders for various technologies, including SNMP and syslog. The oVirt Engine Extension Logger log4j passes the engine.log files to an existing syslog server. The configuration procedure overlaps with Setting up a Host Logging Server . Use this procedure on the central syslog server. You can use a separate logging server, or use this procedure to pass the engine.log files from the Manager to the syslog server. Note To define the syslog server for this extension, navigate to the /etc/ovirt-engine/extensions.d directory and edit the value for log4j.appender.myappender.SyslogHost in the Log4jLogger.properties file. To define the syslog facility, navigate to the /etc/ovirt-engine/extensions.d directory and edit the value for log4j.appender.myappender.Facility in the Log4jLogger.properties file. For example, log4j.appender.myappender.Facility=local1 . Configuring the oVirt Engine Extension Logger log4j Install the extension. Create the Log4jLogger.properties file in the /etc/ovirt-engine/extensions.d/ directory and include the following contents. Install and configure rsyslog. Configure SELinux to allow rsyslog traffic. Edit /etc/rsyslog.conf and add the following lines: Uncomment the following two lines. Restart the rsyslog service: If the firewall is enabled and active, run the following command to add the necessary rules for opening the rsyslog ports in Firewalld. Restart Red Hat Virtualization Manager. The existing syslog server can now receive and store the engine.log files.
yum install ovirt-engine-extension-logger-log4j ovirt.engine.extension.name = log4jlogger ovirt.engine.extension.provides = org.ovirt.engine.api.extensions.logger.Logger ovirt.engine.extension.bindings.method = jbossmodule ovirt.engine.extension.binding.jbossmodule.module = org.ovirt.engine-extensions.logger.log4j ovirt.engine.extension.binding.jbossmodule.class = org.ovirt.engineextensions.logger.log4j.Log4jLogger log4j.rootLogger=DEBUG, myappender log4j.appender.myappender=org.apache.log4j.net.SyslogAppender log4j.appender.myappender.SyslogHost=localhost log4j.appender.myappender.layout=org.apache.log4j.PatternLayout log4j.appender.myappender.layout.ConversionPattern=[%c] %m%n yum install rsyslog semanage port -a -t syslogd_port_t -p udp 514 USDtemplate TmplAuth, "/var/log/%fromhost%/secure" USDtemplate TmplMsg, "/var/log/%fromhost%/messages" USDRuleSet remote authpriv.* ?TmplAuth *.info,mail.none;authpriv.none,cron.none ?TmplMsg USDRuleSet RSYSLOG_DefaultRuleset USDInputUDPServerBindRuleset remote #USDModLoad imudp #USDUDPServerRun 514 systemctl restart rsyslog.service firewall-cmd --permanent --add-port=514/udp firewall-cmd --reload restart ovirt-engine