Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Native logging module not printing to stdout in AzureML

I am trying to use the standard logging module in my AzureML run but nothing gets printed out to stdout.

I tried following instructions from here but I have not been successful.

This is what I am running:

import logging

logging.basicConfig(level=logging.DEBUG)

logger = logging.getLogger(__name__)

logger.info('WHY IS THIS NOT WORKING?')

Am I doing something wrong?

like image 384
muzio Avatar asked Nov 14 '25 19:11

muzio


2 Answers

stdout is generally redirected to a log file called "70_driver_log.txt", and with no configuration a local run submission should honor the basicConfig and you should see the output there.

You can fetch the logs from the UI or by streaming the logs in the SDK via run.wait_for_completion(show_output=True)

This is the link to the UI screenshot (but don't have the rep to post an image): driver log in the ML studio

like image 116
AK - MSFT Avatar answered Nov 17 '25 11:11

AK - MSFT


Following piece of code worked for me. I guess, setting the handler is the key here.

import logging

handler = logging.StreamHandler()
logger = logging.getLogger(__name__)
logger.addHandler(handler)
logger.setLevel(logging.INFO)

More detailed response as well alternative approach about the issue can be found here.

like image 36
Arnab Biswas Avatar answered Nov 17 '25 11:11

Arnab Biswas



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!