Bug 1017042

Summary: Externalize configuration of log level from /usr/share/ovirt-engine/services/ovirt-engine/ovirt-engine.xml.in not to make it overwritten
Product: Red Hat Enterprise Virtualization Manager Reporter: Jiri Belka <jbelka>
Component: ovirt-engineAssignee: Alon Bar-Lev <alonbl>
Status: CLOSED WONTFIX QA Contact:
Severity: medium Docs Contact:
Priority: medium    
Version: 3.3.0CC: acathrow, alonbl, iheim, juan.hernandez, lpeer, oschreib, pstehlik, Rhev-m-bugs, sbonazzo, s.kieske, yeylon
Target Milestone: ---Keywords: Reopened, Triaged
Target Release: 3.4.0   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard: integration
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2014-04-29 12:45:55 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Jiri Belka 2013-10-09 08:07:06 UTC
Description of problem:
For obvious purpose we change log level to DEBUG in /usr/share/ovirt-engine/services/ovirt-engine/ovirt-engine.xml.in. As this file is not marked as config, it is replaces by any rpm reinstall/upgrade...

This file is editable, if one need to change anything in it like log level it is here in this file where to change it. So, logically it is a config file.

As it is logically config file, it should be:

* "protected" and not dumbly replace with rpm
* /usr is not usual place for files to be edited, so maybe its location should be revised and placed into usual /etc

# rpm -qf  /usr/share/ovirt-engine/services/ovirt-engine/ovirt-engine.xml.in
rhevm-backend-3.3.0-0.24.master.el6ev.noarch
# rpm -qlc rhevm-backend
/etc/logrotate.d/ovirt-engine
/etc/ovirt-engine/sysprep/sysprep.2k12x64
/etc/ovirt-engine/sysprep/sysprep.2k3
/etc/ovirt-engine/sysprep/sysprep.2k8
/etc/ovirt-engine/sysprep/sysprep.2k8x86
/etc/ovirt-engine/sysprep/sysprep.w7
/etc/ovirt-engine/sysprep/sysprep.w7x64
/etc/ovirt-engine/sysprep/sysprep.w8
/etc/ovirt-engine/sysprep/sysprep.w8x64
/etc/ovirt-engine/sysprep/sysprep.xp
/etc/pki/ovirt-engine/cacert.template
/etc/pki/ovirt-engine/cacert.template.in
/etc/pki/ovirt-engine/cert.template
/etc/pki/ovirt-engine/cert.template.in
/etc/pki/ovirt-engine/database.txt
/etc/pki/ovirt-engine/openssl.conf
/etc/pki/ovirt-engine/serial.txt

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

How reproducible:
100%

Steps to Reproduce:
1. edit file
2. reinstall, upgrade rpm
3.

Actual results:
modifications are lost

Expected results:
modifications should be kept

Additional info:

Comment 1 Itamar Heim 2013-10-10 06:38:19 UTC
config files should be under /etc.
I'm not sure we shouldn't override this file. i'd expect it will break the app on upgrades.

Comment 2 Alon Bar-Lev 2013-10-10 07:33:42 UTC
> This file is editable, if one need to change anything in it like log level it is here in this file where to change it. So, logically it is a config file.

This is not config file. It should not be modified, unless there is a good reason for local temporary problem determination.

The problem is that jboss does not support proper packaging, overriding attributes but entire file, and we cannot perceive application specific core file that *IS* changing each version, and controlling how application actually runs.

What we have done is generate the file out of template, so we can add specific variables within this file as $getstring('XXX') which will be gotten out of /etc/ovirt-engine/engine.conf[.d/*].

So if you have specific behaviors that should remain after upgrade we can consider to include these.

I though several times to include the log, however, I realized that there are requests to add specific components which we cannot anticipate ahead, so I dropped the idea.

Comment 3 Alon Bar-Lev 2013-10-25 16:36:59 UTC
Please reopen if have any more input.
Thanks!

Comment 4 Jiri Belka 2014-01-17 12:45:44 UTC
> So if you have specific behaviors that should remain after upgrade we can
> consider to include these.

Yes I have - debug log level. Please do anything so I, we (QE), customers can define DEBUG level somewhere in /etc, thus it would be "save" from being overwritten. It is super annoying to find a bug and then discover that default log level is useless (as upgrade did overwrote it). And INFO log level makes our devs not very excited.

Comment 5 Alon Bar-Lev 2014-01-17 13:14:09 UTC
if this only for QE we can add a variable at /etc/ovirt-enigne.conf[.d/*], example:

ENGINE_JBOSS_LOGGING="<logger category=\"org.ovirt.engine.core.bll\"><level name=\"DEBUG\"/></logger>"

this will injected directly into the jboss configuration under <subsystem xmlns="urn:jboss:domain:logging:1.1">.

please confirm this is sufficient.

Comment 6 Jiri Belka 2014-01-17 13:29:13 UTC
We define this:

<!-- Only the engine messages go here: -->
      <file-handler name="ENGINE" autoflush="true">
        <level name="DEBUG"/>
        <formatter>
          .....
<logger category="org.ovirt.engine.core.bll">
        <level name="DEBUG"/>

Comment 7 Alon Bar-Lev 2014-01-17 13:40:56 UTC
(In reply to Jiri Belka from comment #6)
> We define this:
> 
> <!-- Only the engine messages go here: -->
>       <file-handler name="ENGINE" autoflush="true">
>         <level name="DEBUG"/>
>         <formatter>
>           .....
> <logger category="org.ovirt.engine.core.bll">
>         <level name="DEBUG"/>

ENGINE_JBOSS_ENGINE_ATTRS="autoflush=\"true\""
ENGINE_JBOSS_LOGGING="<logger category=\"org.ovirt.engine.core.bll\"><level name=\"DEBUG\"/></logger>"

Comment 8 Alon Bar-Lev 2014-01-17 13:41:29 UTC
(In reply to Alon Bar-Lev from comment #7)
> (In reply to Jiri Belka from comment #6)
> > We define this:
> > 
> > <!-- Only the engine messages go here: -->
> >       <file-handler name="ENGINE" autoflush="true">
> >         <level name="DEBUG"/>
> >         <formatter>
> >           .....
> > <logger category="org.ovirt.engine.core.bll">
> >         <level name="DEBUG"/>
> 
> ENGINE_JBOSS_ENGINE_ATTRS="autoflush=\"true\""
> ENGINE_JBOSS_LOGGING="<logger category=\"org.ovirt.engine.core.bll\"><level
> name=\"DEBUG\"/></logger>"

Sorry:

ENGINE_JBOSS_LOGGING_ENGINE_ATTRS="autoflush=\"true\""
ENGINE_JBOSS_LOGGING="<logger category=\"org.ovirt.engine.core.bll\"><level name=\"DEBUG\"/></logger>"

Comment 9 Alon Bar-Lev 2014-01-17 13:43:22 UTC
hmmm... autoflush="true" is by default (current), no need to have it more complex. Back to my initial suggestion, the following should be sufficient:

ENGINE_JBOSS_LOGGING="<logger category=\"org.ovirt.engine.core.bll\"><level name=\"DEBUG\"/></logger>"

Comment 10 Alon Bar-Lev 2014-01-17 13:45:14 UTC
oh... sorry for the noise... you meant the <level name="INFO"/> within the ENGINE, I think it can be DEBUG per default at handler as all loggers can be set as at least INFO.

Comment 11 Alon Bar-Lev 2014-01-17 14:03:09 UTC
OK, short talk with jiri, he would like this to be exposed to users, be more specific than what I recommended as a solution for the local problem that can be used by support if required.

Having specific solution means that if we want to control precise logging option we need to sync the packaging with the changes within the engine, update documentation and implementation as we go.

I do not believe that this worth the effort.

Comment 12 Doron Fediuck 2014-04-29 12:45:55 UTC
Based on comment 11 we will not handle it,
and closing as won't fix. If you wish  to provide
a solution, patches are welcomed.