Reputation: 538
My Azure function is currently logging to Application Insights.
While Logs generated by logger.logInformation line is showing up on Application Insights, logs generated by logger.logDebug line is not showing up.
I heard there is a way to temporarily enable logging through this line by enabling certain logging levels for application insights.
Can someone help me achieve this or direct me towards some documentation?
Thanks :)
Upvotes: 4
Views: 3419
Reputation: 29940
A detailed steps as below:
1.Nav to your function app kudu console: https://your_function_name.scm.azurewebsites.net/DebugConsole
2.In kudu console, nav to the host.json(D:\home\site\wwwroot
), then click edit button for host.json:
3.Modify the host.json like below, then save it:
4.After run your function app, go to application insights search, you will find the debug message:
In application insights, check the debug message:
5.For v1 function, you should use the link as per @Kath metioned, to modify the host.json.
Upvotes: 1
Reputation: 1111
You're looking for the logLevel
setting in host.json
(Assumes Functions V2. For Functions V1, look at the logger
setting.) Documentation for both here.
Upvotes: 2