Docker log duplication in VS
- Dominant language
- C#
- Stars
- 38.4k
- Forks
- 10.9k
- Avg merge
- 2d 6h
- Merged PRs (30d)
- 290
Description
Docker logs are duplicated in VS when you run under the debugger (F5). The two loggers are the console logger and the debug logger. Both logs are routed to the VS Debug output window. We should find a way to detect this and suppress the console logger.
Generic host 3.0.0-preview3:
```
Microsoft.Hosting.Lifetime: Information: Application started. Press Ctrl+C to shut down.
[40m[32minfo[39m[22m[49m: Microsoft.Hosting.Lifetime[0]
Application started. Press Ctrl+C to shut down.
[40m[32minfo[39m[22m[49m: Microsoft.Hosting.Lifetime[0]
Hosting environment: Production
Microsoft.Hosting.Lifetime: Information: Hosting environment: Production
[40m[32minfo[39m[22m[49m: Microsoft.Hosting.Lifetime[0]
Content root path: /app
Microsoft.Hosting.Lifetime: Information: Content root path: /app
The program '[314] dotnet' has exited with code 0 (0x0).
The program 'dotnet' has exited with code 0 (0x0).
```
Side note: the control characters are the console color markers. https://github.com/aspnet/Extensions/issues/673
WebHost (3.0.0-preview1):
```
Microsoft.AspNetCore.Hosting.Internal.WebHost:Information: Request starting HTTP/1.1 GET https://localhost:44330/
[40m[32minfo[39m[22m[49m: Microsoft.AspNetCore.Hosting.Internal.WebHost[1]
Request starting HTTP/1.1 GET https://localhost:44330/
Loaded '/usr/share/dotnet/shared/Microsoft.AspNetCore.App/2.2.2/Microsoft.AspNetCore.WebUtilities.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
Microsoft.AspNetCore.Hosting.Internal.WebHost:Information: Request finished in 116.2878ms 200
[40m[32minfo[39m[22m[49m: Microsoft.AspNetCore.Hosting.Internal.WebHost[2]
Request finished in 116.2878ms 200
[40m[32minfo[39m[22m[49m: Microsoft.AspNetCore.Hosting.Internal.WebHost[1]
Request starting HTTP/1.1 GET https://localhost:44330/favicon.ico
Microsoft.AspNetCore.Hosting.Internal.WebHost:Information: Request starting HTTP/1.1 GET https://localhost:44330/favicon.ico
[40m[32minfo[39m[22m[49m: Microsoft.AspNetCore.Hosting.Internal.WebHost[2]
Request finished in 15.0096ms 200
Microsoft.AspNetCore.Hosting.Internal.WebHost:Information: Request finished in 15.0096ms 200
```
@glennc
Contributor guide
Assessment
This issue has not been assessed yet.