英文:
How to tail log from go app on Azure Web App
问题
我正在尝试找到如何使我的Go应用程序中的fmt.Printf
或log.Printf
像我们可以为.NET或Node应用程序一样被记录或记录到应用程序日志中的方法。
根据这篇文章(存档链接),通过从门户启用应用程序日志,所有的标准输出应该被记录。但是由于某些原因,无论是使用Azure CLI还是下载日志时,我的日志输出都没有被打印出来。在诊断.zip的LogFiles目录中没有应用程序目录。
在Node中,我使用IISNode.yml
文件来告诉将console.log
记录到应用程序日志中。在Go应用程序中是否有类似的方法?
loggingEnabled: true
devErrorsEnabled: true
英文:
I'm trying to find how I can have my fmt.Printf
or log.Printf
from my go app being tail or logged like we are able to do for .NET or Node apps to the Application logs.
Based on this article (archive link) by enabling the Application logging from the portal all stdout should be logged. But for some reasons my log output are not printed either when using the azure CLI or downloading the log. There's no Application directory in the LogFiles directory of the diagnostics.zip.
azure site log tail sitename
or azure site log download sitename
In Node I use the IISNode.yml
file to tell to log the console.log
to the application log. Is there a similar way of doing this for go app?
loggingEnabled: true
devErrorsEnabled: true
答案1
得分: 2
我们还没有为Go应用程序实现日志记录。这是我们存储库中的待办工作项:https://github.com/projectkudu/kudu/issues/1535
请随时在我们的Github问题中提出您的需求,我们将根据计划进行评估和解决。
目前,您需要自行处理日志记录。
英文:
We haven`t implement logging for Go application yet. Here is the pending work item in our repository https://github.com/projectkudu/kudu/issues/1535
Feel free to raise your needs onto our Github issue, and we will triage and address it according to schedule.
As of now, you will need to handle your own logging.
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论