I try to log handled exception from my Python Azure Function in Application Insights as exception. Whatever i do it is always written as track with error severity level. Output in local console is "red" as excepted.
What i tried:
Changing function.json logging section to:
"ApplicationInsights": { "LogLevel": { "Default": "Error" }various calls of exception method
except Exception as e:
logger.exception("An error has occured",exc_info=e)
logger.exception("An error has occured")
logger.exception()
- tried to call telmetry client directly
tc.track_exception()
- clearing and adding handlers to logger
Edit:
Example to clarify what i mean: image
logger.error('My exception', exc_info=True)logger.error('My exception: {}.format(e))