microsoft / microsoft/aspire

Single File App Host logs are more verbose than non single file apps

Open
#14,876 0 comments 0 reactions 0 assignees View on GitHub
area-app-model
Dominant language
C#
Stars
6.3k
Forks
991
Avg merge
2d 15h
Merged PRs (30d)
196

Description

### Is there an existing issue for this?

- [x] I have searched the existing issues

### Describe the bug

If you create a new single file app host, logging is more verbose than if you create a "full fat" app host. In particular you see a lot of noise from the Resource Server logs

```
Request starting HTTP/2 POST http://127.0.0.1:62203/aspire.v1.DashboardService/GetApplicationInformation - application/grpc -
Executing endpoint 'gRPC - /aspire.v1.DashboardService/GetApplicationInformation'
Executed endpoint 'gRPC - /aspire.v1.DashboardService/GetApplicationInformation'
Request finished HTTP/2 POST http://127.0.0.1:62203/aspire.v1.DashboardService/GetApplicationInformation - 200 - application/grpc 142.1243ms
Request starting HTTP/2 POST http://127.0.0.1:62203/aspire.v1.DashboardService/WatchInteractions - application/grpc -
Request starting HTTP/2 POST http://127.0.0.1:62203/aspire.v1.DashboardService/WatchResources - application/grpc -
Executing endpoint 'gRPC - /aspire.v1.DashboardService/WatchInteractions'
Executing endpoint 'gRPC - /aspire.v1.DashboardService/WatchResources'
Request starting HTTP/2 POST http://127.0.0.1:62203/aspire.v1.DashboardService/WatchResourceConsoleLogs - application/grpc -
Executing endpoint 'gRPC - /aspire.v1.DashboardService/WatchResourceConsoleLogs'
```

This is because the full fat app host includes the following logging configuration in `appsettings.json`, which is missing from the single file apphost.

```json
{
"Logging": {
"LogLevel": {
"Default": "Information",
"Microsoft.AspNetCore": "Warning",
"Aspire.Hosting.Dcp": "Warning"
}
}
}
```

### Expected Behavior

I expect logging output to be equalivent between single file app hosts, and full fat app hosts.

### Steps To Reproduce

`aspire new` to create a single file app host, then run it.

Can be fixed by adding the following env vars to `apphost.run.json`
```
"Logging__LogLevel__Microsoft.AspNetCore": "Warning",
"Logging__LogLevel__Aspire.Hosting.Dcp": "Warning"
```

### Exceptions (if any)

_No response_

### .NET Version info

13.1.2+895a2f0b09d747a052aaaf0273d55ad0e2dc95b0

### Anything else?

_No response_

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.