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   
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
: 979734 (view as bug list) Environment:
Last Closed: 2013-04-04 16:24:08 EDT Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---
Bug Depends On:    
Bug Blocks: 979734    
Description Flags
Proposed patch for snap5 eglynn: review+, derekh: review+, apevec: review+

Description Russell Bryant 2012-12-17 18:48:21 EST
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):

Comment 2 Alan Pevec 2012-12-21 12:57:36 EST
(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:
    elif CONF.verbose:

but in glance/openstack/common/log.py

    if CONF.verbose or CONF.debug:

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

Comment 3 Eoghan Glynn 2012-12-21 13:06:41 EST
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:


(as opposed to changing the upstream behaviour that others may be depending on)
Comment 4 Derek Higgins 2013-02-22 09:02:26 EST
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 18:05:03 EDT
Created attachment 708668 [details]
Proposed patch for snap5
Comment 6 Derek Higgins 2013-03-11 18:54:01 EDT
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 18:56:31 EDT
I tested it out and --verbose did not seem to cause DEBUG logging.
Comment 8 Eoghan Glynn 2013-03-12 09:09:48 EDT
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 12:12:12 EDT
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 14:25:33 EDT
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 16:00:59 EDT
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:

Comment 18 errata-xmlrpc 2013-04-04 16:24:08 EDT
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.