Find answers from the community

Updated last year

logs

At a glance

The community member disabled logging in their code, but they were still getting logs when calling Azure Open AI. The comments suggest that setting openai.log = "debug" also prints logs, and the community member had to specifically change openai.util.logging.getLogger().setLevel(logging.WARNING) to stop the logs. The community member was doing this in a Jupyter notebook in VSCode, and they found that restarting the kernel fixed the issue, as the Python logging session was maintained even after deleting the openai.log = "debug" code.

Even though I disable logging like so
Plain Text
logging.basicConfig(stream=sys.stdout, level=logging.INFO)
logging.getLogger().addHandler(logging.StreamHandler(stream=sys.stdout))
logger = logging.getLogger()
logger.disabled = True


and I commented out llama_debug = LlamaDebugHandler()

I still get Logs when calling Azure Open AI. Any idea why that might be the case?

Plain Text
DEBUG:openai:message='Request to OpenAI API' method=post path...
W
c
10 comments
openai.log = "debug" to the code?
This also print logs
I deleted that code (openai.log = "debug" ) so I assumed it would stop, but no I had to specifically change openai with

openai.util.logging.getLogger().setLevel(logging.WARNING)
So I'm assuming all good now? lol πŸ˜…
I'm doing this on a jupyter notebook in vscode. It's just really weird that without that line of code it would still log.
yes all good πŸ™πŸ»
Yeah so jupyter session would have been active, So even deleting would not replace the already made change.
you taught me that some libraries like the Python Log maintains session... 😒

and I've been having Debug:openai duplicated 8 times for a while now.

restarting the Kernel fixed everything 😭 savior!
Add a reply
Sign up and join the conversation on Discord