Azure / Azure/azure-functions-python-worker

How to see logs at global level?

未关闭
#1,728 2 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看
area:python-functions Needs: Triage :mag: python
主要语言
Python
星标
357
派生
116
平均合并
32 分钟
30 天内合并 PR
1

描述

Suppose I have a following `global_settings.py` file.
```python
logging.info("Setting global variables")
blob_name = "stgblob"
mongo_url = ""
logging.info("Global variables initialized")
```
And I import these in the `function_app.py`
```python
from global_settings import blob_name, mongo_url

... function code
```

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.

贡献指南

打开贡献指南

调研方向

使用 global_settings.py、function_app.py、host.json 以及报告中的 func host start --verbose 命令重现本地运行。跟踪导入的模块何时初始化,并将其与 worker 的本地日志输出进行比较;当模块的启动消息在本地执行期间可见时,该 issue 即得到解决。

由索引模型根据 Issue 内容生成。

评估

技术栈
azure, python
领域
backend, cloud
Issue 类型
缺陷
难度
3/5
预计耗时
1-2 天
活跃度
停滞
描述清晰度
需要澄清
新手友好度
30/100

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。