Skip to main content

If I have my own logger+handler and not using BasicConfig… so like this…



chandler = logging.StreamHandler() 

chandler.setFormatter(logging.Formatter('e%(levelname)s] %(asctime)s %(message)s'))

logger = logging.getLogger("my_custom_logs")

logger.setLevel(logging.DEBUG)

logger.addHandler(chandler)



I’m getting weirdness with client.uploads.upload_file_version where it hangs for 10mins, then the created version is blank. It’s not throwing any Exceptions and nothing lands in my logger



What’s the correct way to get debug logs from the BoxClient?

Hi @NickB , welcome to the forum!!!



I typically do something like this:



logging.getLogger("box_sdk_gen").setLevel(logging.CRITICAL)



Let us know if this helps.


Hi,


currently box_sdk_gen doesn’t have any dedicated logger, but you can use one provided by requests library. To enable logging of all requests and responses use this snippet:



from urllib3.connection import HTTPConnection



HTTPConnection.debuglevel = 1

logging.getLogger().setLevel(logging.DEBUG)


Reply