shirisht on Tue, 09 Oct 2018 07:38:24
AhmedElSayed on Tue, 09 Oct 2018 22:25:14
If you follow that link you'll be able to see the stdout logs from your container.
If you're looking for functions specific logs, i.e: logs written to ILogger in your function or events from your function, you should check Application Insights (see this for details)
If you're looking for file logging from your function app, enable file logging in your host.json, then the logs should be present at /home/LogFiles/Application/Functions/
shirisht on Wed, 10 Oct 2018 19:18:08
Thank you @AhmedElSayed. Can you tell me how do I enable file logging in host.json?
The code I have in my python function code is the following:
logging.basicConfig(filename='/home/LogFiles/mylog2.txt',format='%(asctime)s %(levelname)s: %(message)s',level=logging.DEBUG)
I tried setting WEBSITES_ENABLE_APP_SERVICE_STORAGE=true hoping that I will be able to see `mylog2.txt` in the kudu container but failed the whole application. I saw from your previous posts (such as https://github.com/Azure/azure-functions-host/issues/2631) that we SHOULD NOT enable this flag.
I hope enabling file logging in host.json will do the trick. Is that right? Can you please advise how to do it?
shirisht on Wed, 10 Oct 2018 19:20:32
I should have been more clear. I see a related setting here: https://docs.microsoft.com/en-us/azure/azure-functions/functions-host-json#logging
but I am wondering how I can specify the file name. Otherwise, which file would contain the logs?