Runtime enabling/disabling of debug logs in nova/glance

asked 2015-10-13 10:41:06 -0600

anantkaushik-nsit gravatar image

Hello all,

I wanted to be able to turn off/on the logging in debug mode for nova/glance. Is there some support built in for this?

My approach is to use an env variable. I would set an env variable to False in in oslo_log. Then i would start an async process which would check when this value changes. My callback function would change the logging mode based on the env variable, and I would again call the async process to continue checking for next change of the env variable.

Please let me know what is the way to better this.


edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted

answered 2015-10-14 04:19:28 -0600 gravatar image

Nova logs can be configured ( enable/disable) by the change in file "/etc/nova/nova.conf" : enable=debug.

To add custom logging :- The source files are located in /usr/lib/python2.7/dist-packages/nova and add logging statements near the top of the file -

from nova.openstack.common import log as logging LOG = logging.getLogger(__name__)

To add a DEBUG logging statement, you would do: LOG.debug("This is a custom debugging statement")

edit flag offensive delete link more


The problem with the above approach is that it is not runtime, I cant enable or disable it without restarting the whole service, like nova-api and nova-compute.

anantkaushik-nsit gravatar imageanantkaushik-nsit ( 2015-10-14 15:55:24 -0600 )edit

ok..... so its difficult to find the ways to enable/disable logs at run time, but yes, if you want to have some debugging info or messages you can use python scripts to capture messages from message broker. It might be near to you requirement. gravatar ( 2015-10-14 23:41:27 -0600 )edit

Get to know Ask OpenStack

Resources for moderators

Question Tools

1 follower


Asked: 2015-10-13 10:41:06 -0600

Seen: 1,061 times

Last updated: Oct 14 '15