You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am unable to see the logs while running locally on vscode. Can anyone help me tell how to see them? I have tried func host start --verbose and settings default logging level to information in host.json but it didn't work.
i have the following top level statements in function_app.py that i use for local debug - 2 slightly different approaches, depending on if you want handle some specific logging types or not. (watch out that all http posts done are at logging info, so this can spew lots of logs)
# copy logs to standard output
logging.basicConfig(
level=logging.INFO,
format='%(asctime)s - %(name)s - %(levelname)s - %(message)s',
stream=sys.stdout,
)
# This will print detailed logs from the Azure Identity library to your console
#logger = logging.getLogger('azure.identity')
#logger.setLevel(logging.DEBUG)
#handler = logging.StreamHandler(sys.stdout)
#handler.setFormatter(logging.Formatter('%(asctime)s - %(name)s - %(levelname)s - %(message)s'))
#logger.addHandler(handler)
Andrew Hill (@AartBluestoke) thanks for the comment but I think neither will help. basicConfig can't work as there are existing handlers. Adding a custom handler to print to stdout might work in local, but not sure if it will go to the logs tab in azure or application insights.
Activity
AartBluestoke commentedon Aug 1, 2025
i have the following top level statements in function_app.py that i use for local debug - 2 slightly different approaches, depending on if you want handle some specific logging types or not. (watch out that all http posts done are at logging info, so this can spew lots of logs)
d-s-dc commentedon Aug 3, 2025
Andrew Hill (@AartBluestoke) thanks for the comment but I think neither will help.
basicConfigcan't work as there are existing handlers. Adding a custom handler to print tostdoutmight work in local, but not sure if it will go to thelogstab in azure or application insights.