Bugzilla (bugzilla.redhat.com) will be under maintenance for infrastructure upgrades and will not be available on July 31st between 12:30 AM - 05:30 AM UTC. We appreciate your understanding and patience. You can follow status.redhat.com for details.
Bug 1576967 - [Docs] Steps required for ovirt-engine-extension-logger-log4j configuration
Summary: [Docs] Steps required for ovirt-engine-extension-logger-log4j configuration
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Red Hat Enterprise Virtualization Manager
Classification: Red Hat
Component: Documentation
Version: 4.1.11
Hardware: Unspecified
OS: Unspecified
low
medium
Target Milestone: ovirt-4.3.4
: 4.3.0
Assignee: Scott Borella
QA Contact: Eli Marcus
URL:
Whiteboard:
Depends On:
Blocks: 1547768
TreeView+ depends on / blocked
 
Reported: 2018-05-10 21:10 UTC by Chetan Nagarkar
Modified: 2020-02-26 15:21 UTC (History)
16 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
This release defines the configuration procedure to send engine.log files to the syslog server using the ovirt-engine-extension-logger-log4j package.
Clone Of:
Environment:
Last Closed: 2019-05-16 14:17:07 UTC
oVirt Team: Infra
Target Upstream Version:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Knowledge Base (Solution) 3460571 0 None None None 2018-07-27 19:09:41 UTC

Description Chetan Nagarkar 2018-05-10 21:10:52 UTC
Description of problem:

Configuration provided in '/usr/share/doc/ovirt-engine-extension-logger-log4j-1.0.2/README' is not very clear to customers.

Need configuration steps and specifically examples of configuring RHV to log to syslog.

Version-Release number of selected component (if applicable):
4.1.11

Comment 6 Ravi Nori 2018-07-29 17:24:24 UTC
1. It should be 

ovirt.engine.extension.name = XYZ

2. Engine needs to be restarted

3. log4j.appender.myappender.SyslogHost=1.2.3.4 should work just fine

4. In addition to engine logs the log information is sent to syslog as configured

5. Nothing else needs to be changed

log4j already has a comprehensive documentation on  “%” substitutions here [1]

[1] https://logging.apache.org/log4j/1.2/apidocs/org/apache/log4j/PatternLayout.html

Comment 7 Martin Perina 2018-07-29 20:13:34 UTC
Moving to Cheryl, if needed feel free to ask if anything is not clear.

Comment 19 Ravi Nori 2019-01-24 15:17:45 UTC
# yum install ovirt-engine-extension-logger-log4j

create a file /etc/ovirt-engine/extensions.d/Log4jLogger.properties with 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

Install and configure rsyslog
# yum install rsyslog

Configure SELinux to allow rsyslog traffic.

# semanage port -a -t syslogd_port_t -p udp 514

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

Uncomment the following:

#$ModLoad imudp
#$UDPServerRun 514

Restart the rsyslog service:

# systemctl restart rsyslog.service

If the firewall is enabled and active, run the below command in order to add the necessary rules for opening rsyslog ports in Firewalld.

# firewall-cmd --permanent --add-port=514/udp
# firewall-cmd --reload

Restart ovirt-engine

# systemctl restart ovirt-engine

You should see ovirt-engine logs in /var/log/messages

Comment 20 Sandro Bonazzola 2019-01-28 09:43:56 UTC
This bug has not been marked as blocker for oVirt 4.3.0.
Since we are releasing it tomorrow, January 29th, this bug has been re-targeted to 4.3.1.


Note You need to log in before you can comment on or make changes to this bug.