Bug 888077

Summary: Glance logs should not include DEBUG by default
Product: Red Hat OpenStack Reporter: Russell Bryant <rbryant>
Component: openstack-glanceAssignee: John Bresnahan <jbresnah>
Status: CLOSED ERRATA QA Contact: Attila Fazekas <afazekas>
Severity: medium Docs Contact:
Priority: medium    
Version: 2.1CC: abaron, derekh, eglynn, jbresnah
Target Milestone: snapshot5Keywords: Triaged
Target Release: 2.1   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
: 979734 (view as bug list) Environment:
Last Closed: 2013-04-04 20:24:08 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:
Bug Depends On:    
Bug Blocks: 979734    
Attachments:
Description Flags
Proposed patch for snap5 eglynn: review+, derekh: review+, apevec: review+

Description Russell Bryant 2012-12-17 23:48:21 UTC
Description of problem:

After following the instructions for installing and configuring glance in the Folsom getting started guide, I noticed that the logs in /var/log/glance/ included DEBUG output by default.  This is incredibly verbose and should only be enabled if needed by an administrator in my opinion.

This is due to "verbose = True" being set in glance-api.conf and glance-registry.conf by default.

    # Show more verbose log output (sets INFO log level output)
    verbose = True

Note that "debug = False" is set as well.  Despite what the comment in the sample configuration says, enabling the verbose option turns on DEBUG, not just INFO.

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

openstack-glance-2012.2.1-1.el6ost.noarch
python-glance-2012.2.1-1.el6ost.noarch

Comment 2 Alan Pevec 2012-12-21 17:57:36 UTC
(In reply to comment #0)
> Despite what the comment in the sample configuration says,
> enabling the verbose option turns on DEBUG, not just INFO.

Interesting, in glance/common/config.py
    if CONF.debug:
        root_logger.setLevel(logging.DEBUG)
    elif CONF.verbose:
        root_logger.setLevel(logging.INFO)
    else:
        root_logger.setLevel(logging.WARNING)

but in glance/openstack/common/log.py

    if CONF.verbose or CONF.debug:
        log_root.setLevel(logging.DEBUG)
    else:
        log_root.setLevel(logging.INFO)

Looks like a bug in openstack-common, inherited from Nova?

https://github.com/openstack/oslo-incubator/commit/16916b61

Comment 3 Eoghan Glynn 2012-12-21 18:06:41 UTC
Yes Alan, that makes sense.

Though we may find more convenient to fix by overriding the default verbose setting to false in glance-{api|registry}.conf via some addition 'openstack-config --set' calls in:

  https://github.com/fedora-openstack/openstack-glance/blob/master/openstack-glance.spec

(as opposed to changing the upstream behaviour that others may be depending on)

Comment 4 Derek Higgins 2013-02-22 14:02:26 UTC
Also note it isn't just the config file the services are being run with 
--debug --verbose

glance   25639     1  0 08:30 ?        00:00:00 /usr/bin/python /usr/bin/glance-api --config-file /usr/share/glance/glance-api-dist.conf --config-file /etc/glance/glance-api.conf --debug --verbose

glance   25662     1  0 08:30 ?        00:00:00 /usr/bin/python /usr/bin/glance-registry --config-file /usr/share/glance/glance-registry-dist.conf --config-file /etc/glance/glance-registry.conf --debug --verbose

Comment 5 John Bresnahan 2013-03-11 22:05:03 UTC
Created attachment 708668 [details]
Proposed patch for snap5

Comment 6 Derek Higgins 2013-03-11 22:54:01 UTC
Comment on attachment 708668 [details]
Proposed patch for snap5

I'm just wondering if --verbose also needs to be removed from the command line ?

Comment 7 John Bresnahan 2013-03-11 22:56:31 UTC
I tested it out and --verbose did not seem to cause DEBUG logging.

Comment 8 Eoghan Glynn 2013-03-12 13:09:48 UTC
Comment on attachment 708668 [details]
Proposed patch for snap5

If --verbose on the command line does not cause DEBUG logging, shouldn't it be removed from the command line?

Otherwise it may cause confusion in the output of ps -f.

Comment 9 John Bresnahan 2013-03-12 16:12:12 UTC
I am not certain what the expected behavior is, but the bit of code in comment #2 suggests that --verbose should result in INFO level logging and --debug should result in DEBUG logging.

Comment 10 John Bresnahan 2013-03-12 18:25:33 UTC
From the --help output:

  --debug, -d           Print debugging output (set logging level to DEBUG
                        instead of default WARNING level).
  --verbose, -v         Print more verbose output (set logging level to INFO
                        instead of default WARNING level).

Thus I think we have the correct behavior in this patch

Comment 13 John Bresnahan 2013-03-12 20:00:59 UTC
To test this bug:

1) Install the package
2) Note the time
3) run:

 service openstack-glance-registry restart
 service openstack-glance-api restart
 service openstack-glance-scrubber restart

4) verify that there are no DEBUG log messages after the previously noted time in the files:

  /var/log/glance/api.log
  /var/log/glance/registry.log
  /var/log/glance/scrubber.log

Comment 18 errata-xmlrpc 2013-04-04 20:24:08 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

http://rhn.redhat.com/errata/RHSA-2013-0707.html