Bug 1017042 - Externalize configuration of log level from /usr/share/ovirt-engine/services/ovirt-engine/ovirt-engine.xml.in not to make it overwritten
Externalize configuration of log level from /usr/share/ovirt-engine/services/...
Status: CLOSED WONTFIX
Product: Red Hat Enterprise Virtualization Manager
Classification: Red Hat
Component: ovirt-engine (Show other bugs)
3.3.0
Unspecified Unspecified
medium Severity medium
: ---
: 3.4.0
Assigned To: Alon Bar-Lev
integration
: Reopened, Triaged
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2013-10-09 04:07 EDT by Jiri Belka
Modified: 2014-04-29 08:46 EDT (History)
12 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2014-04-29 08:45:55 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Jiri Belka 2013-10-09 04:07:06 EDT
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 02:38:19 EDT
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 03:33:42 EDT
> 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 12:36:59 EDT
Please reopen if have any more input.
Thanks!
Comment 4 Jiri Belka 2014-01-17 07:45:44 EST
> 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 08:14:09 EST
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 08:29:13 EST
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 08:40:56 EST
(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 08:41:29 EST
(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 08:43:22 EST
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 08:45:14 EST
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 09:03:09 EST
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 08:45:55 EDT
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.

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