Red Hat Bugzilla – Bug 888077
Glance logs should not include DEBUG by default
Last modified: 2016-04-26 17:35:28 EDT
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
(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
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)
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
Created attachment 708668 [details] Proposed patch for snap5
Comment on attachment 708668 [details] Proposed patch for snap5 I'm just wondering if --verbose also needs to be removed from the command line ?
I tested it out and --verbose did not seem to cause DEBUG logging.
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.
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.
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
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
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