Azure function verbose trace logging to Application Insights
You have a lot of control over your log levels for App Insights in Functions, but you don't use the tracing
element for these. We're working on pulling the docs together in one cohesive location, but here's some links that can help:
- The new
logger.categoryLevel
host.json settings: https://github.com/Azure/Azure-Functions/wiki/App-Insights-(Preview)#hostjson-settings - The WebJobs documentation, which gives a bit more detail on how the category filter works (behind the scenes, the host.json settings are serialized into this): https://github.com/Azure/azure-webjobs-sdk/wiki/Application-Insights-Integration#filtering
For your specific example, you can open up all the Debug
logs (which matches Verbose
in TraceWriter
) with this in your host.json:
{ "logger": { "categoryFilter": { "defaultLevel": "Debug" } }}
If you just want to see the verbose logs coming from your Function itself (i.e. you don't want the host's verbose logs appearing), you can restrict that with this -- which says 'for logs with the "Function" category (which is the category that function logs use), show me everything with Debug or higher log level':
{ "logger": { "categoryFilter": { "categoryLevels": { "Function": "Debug" } } }}