Ce contenu n'est pas disponible dans la langue sélectionnée.

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

  1. Install the extension.

    # yum install ovirt-engine-extension-logger-log4j
    Copy to Clipboard Toggle word wrap
  2. Create the Log4jLogger.properties file in the /etc/ovirt-engine/extensions.d/ directory and include the following contents.

    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
    Copy to Clipboard Toggle word wrap
  3. Install and configure rsyslog.

    # yum install rsyslog
    Copy to Clipboard Toggle word wrap
  4. Configure SELinux to allow rsyslog traffic.

    # semanage port -a -t syslogd_port_t -p udp 514
    Copy to Clipboard Toggle word wrap
  5. Edit /etc/rsyslog.conf and add the following lines:

    $template TmplAuth, "/var/log/%fromhost%/secure"
    $template TmplMsg, "/var/log/%fromhost%/messages"
    
    $RuleSet remote
    authpriv.*   ?TmplAuth
    *.info,mail.none;authpriv.none,cron.none   ?TmplMsg
    $RuleSet RSYSLOG_DefaultRuleset
    $InputUDPServerBindRuleset remote
    Copy to Clipboard Toggle word wrap
  6. Uncomment the following two lines.

    #$ModLoad imudp
    #$UDPServerRun 514
    Copy to Clipboard Toggle word wrap
  7. Restart the rsyslog service:

    # systemctl restart rsyslog.service
    Copy to Clipboard Toggle word wrap
  8. If the firewall is enabled and active, run the following command to add the necessary rules for opening the rsyslog ports in Firewalld.

    # firewall-cmd --permanent --add-port=514/udp
    # firewall-cmd --reload
    Copy to Clipboard Toggle word wrap
  9. Restart Red Hat Virtualization Manager.

    # restart ovirt-engine
    Copy to Clipboard Toggle word wrap

The existing syslog server can now receive and store the engine.log files.

Retour au début
Red Hat logoGithubredditYoutubeTwitter

Apprendre

Essayez, achetez et vendez

Communautés

À propos de la documentation Red Hat

Nous aidons les utilisateurs de Red Hat à innover et à atteindre leurs objectifs grâce à nos produits et services avec un contenu auquel ils peuvent faire confiance. Découvrez nos récentes mises à jour.

Rendre l’open source plus inclusif

Red Hat s'engage à remplacer le langage problématique dans notre code, notre documentation et nos propriétés Web. Pour plus de détails, consultez le Blog Red Hat.

À propos de Red Hat

Nous proposons des solutions renforcées qui facilitent le travail des entreprises sur plusieurs plates-formes et environnements, du centre de données central à la périphérie du réseau.

Theme

© 2025 Red Hat