ksuess
(Katja Süss)
1
How do I raise the log level when running console script with zconsole
? For example log level 'debug'.
Any environment variable to set?
This is documented:
$(BIN_FOLDER)/zconsole run instance/etc/zope.conf ./scripts/pipapo.py
Can I do something like this? Anyone knows the spelling of the env variable?
LOGLEVEL=debug $(BIN_FOLDER)/zconsole run instance/etc/zope.conf ./scripts/pipapo.py
1letter
(Jan)
2
Can you set the level in the zope.ini to
[logger_plone]
level = DEBUG
handlers = eventlog
qualname = plone
?
ksuess
(Katja Süss)
3
No. I edited my question for better understanding. I definitly do not want to fiddle neither with the script nor with the Plone setup.
1letter
(Jan)
4
Okay, nevertheless, i think a little bit editing is needed in your script to use a env var to configure the loglevel.
import logging
import os
LOGLEVEL = os.environ.get('LOGLEVEL', 'WARNING').upper()
logging.basicConfig(level=LOGLEVEL)