Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/273.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
无法在azure app insight中查看Python日志_Python_Azure - Fatal编程技术网

无法在azure app insight中查看Python日志

无法在azure app insight中查看Python日志,python,azure,Python,Azure,我有一个使用flask的python应用程序。我使用下面的代码使用OpenCensus将日志发送到azure insight logger = logging.getLogger(__name__) format_str = '%(asctime)s - %(levelname)-8s - %(message)s' date_format = '%Y-%m-%d %H:%M:%S' formatter = logging.Formatter(format_str, date_format) ha

我有一个使用flask的python应用程序。我使用下面的代码使用OpenCensus将日志发送到azure insight

logger = logging.getLogger(__name__)
format_str = '%(asctime)s - %(levelname)-8s - %(message)s'
date_format = '%Y-%m-%d %H:%M:%S'
formatter = logging.Formatter(format_str, date_format)
handler = AzureLogHandler(
     connection_string='InstrumentationKey=key')
handler.setFormatter(formatter)
logger.addHandler(handler)
在函数内部使用

logger.warning(line)
当我尝试记录控制台中可以看到的内容时。当我尝试将日志移动到azure insight时,我没有收到任何异常,但我没有在azure app insight的跟踪结果中获得这些日志。是否有人可以帮助我修复此问题