Azure / Azure/azure-functions-host

Log host debug messages (to Application Insights)

Open
#8,901 9 comments 0 reactions 1 assignee Claimed by @soninaren View on GitHub
Dominant language
C#
Stars
2k
Forks
482
Avg merge
2d 12h
Merged PRs (30d)
38

Description

I'm having difficulties getting debug messages like

`_logger.LogDebug(message);`

as e.g. defined in FunctionsSyncManager.cs logged to Application Insights. It looks like only LogDebug statements with a .CreateLogger() category (as e.g. used in HostController.cs) are processed properly.

host.json is configured for trace debug level "catch-all":

```
{
"version": "2.0",
"logging": {
"applicationInsights": {
"samplingSettings": {
"isEnabled": true,
"excludedTypes": "Request,Trace"
},
"logLevel": {
"Default": "Trace"
}
},
"logLevel": {
"Default": "Trace"
}
},
```

Environment: .Windows .net6 isolated, Function v4

Expected behavior: All (debug) messages are logged to Application Insights with a host.json as defined above.

(Background: My Azure Function is failing to synchronize triggers ("Function app does not contain any active triggers"). Consequently SCM is not scaling the app at all. I hope to find the root-cause in these logs - MS Premier support is struggling with that since several days).

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.