I havent found info in how to log something in the azure logs, I suppose sdk should allow this, if its possible can you provide a small example or link?>

有帮助吗?

解决方案

If you are using the WebJobs SDK then we redirect the standard output stream so if you write to console it should also write to logs.

Example:

Console.WriteLine("Log message");

其他提示

I've not tried this yet but I would think it should be possible to get NLog working in a WebJob.

I could imagine two log targets being configured, one of type ColoredConsole and another of type File. ColoredConsole runs in debug and release mode (when deployed to Azure) and any messages would be directed to log output and viewable in Kudu. The File target could be turned off in Release mode but available when running locally in development.

NLog loggers can be turned off by setting minLevel="Off" in a .config transform file.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top