Azure / Azure/azure-functions-host

ILogger<T> not logging when T is another project

Open
#6,998 7 comments 0 reactions 0 assignees View on GitHub
Dominant language
C#
Stars
2k
Forks
482
Avg merge
2d 10h
Merged PRs (30d)
36

Description

I can see all logs in my functions class but it does not seem to be logging anything from another class in another project.

I have tried all suggestions in issue [4345](https://github.com/Azure/azure-functions-host/issues/4345) and issue [4425](https://github.com/Azure/azure-functions-host/issues/4425).

So, I have tried adding the filter like
```
services.AddLogging(loggingBuilder =>
{
loggingBuilder.SetMinimumLevel(LogLevel.Debug);
loggingBuilder.AddFilter(typeof(Service1).FullName, LogLevel.Debug);
});
```

and also tried in host.json
```
"logLevel": {
// For all functions
"Function": "Debug",
"X.Domain.Suppliers.Service1": "Information",
}
```

and tried the solution name as well like
```
"logLevel": {
// For all functions
"Function": "Debug",
"X-API": "Information",
}
```
I am running this locally with Core Tools Version: 3.0.3160, Function Runtime Version: 3.0.14916.0

Contributor guide

Open the contributing guide

Research direction

Start by reproducing the missing ILogger output using the services.AddLogging configuration and host.json logLevel examples. Check the behavior with Core Tools 3.0.3160 and Function Runtime 3.0.14916.0, comparing logs from the functions class and X.Domain.Suppliers.Service1. Done means identifying whether cross-project logging is expected and providing a verified fix or documented limitation.

Written by the indexing model from the issue text.

Assessment

Tech stack
azure, csharp
Domain
backend, cloud, observability
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.