How to tail log from go app on Azure Web App

huangapple go评论117阅读模式
英文:

How to tail log from go app on Azure Web App

问题

我正在尝试找到如何使我的Go应用程序中的fmt.Printflog.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.

huangapple
  • 本文由 发表于 2015年12月17日 05:57:44
  • 转载请务必保留本文链接:https://go.coder-hub.com/34322855.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定