Ask Your Question
0

Runtime enabling/disabling of debug logs in nova/glance

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

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 log.py 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.

Thanks

edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted
0

answered 2015-10-14 04:19:28 -0500

ritesh.singh.aricent@gmail.com 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

Comments

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 -0500 )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.

ritesh.singh.aricent@gmail.com gravatar imageritesh.singh.aricent@gmail.com ( 2015-10-14 23:41:27 -0500 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Get to know Ask OpenStack

Resources for moderators

Question Tools

1 follower

Stats

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

Seen: 995 times

Last updated: Oct 14 '15