I am trying to get my .net core debug to console so I changed the default in appsettings app.de.settings "Logging": { "LogLevel": { "Default": "Debug", "Microsoft": "Warning", "Microsoft.Hosting.Lifetime": "Information" }
When I run through debugger (F5) or dotnet run on command line, I don't get any "dbug" tag as I noticed in different videos and blogs. What I get, in every project I created, only the following,
info: Microsoft.Hosting.Lifetime[0] Now listening on: http://192.168.1.4:5050 Microsoft.Hosting.Lifetime: Information: Now listening on: http://192.168.1.4:5050 info: Microsoft.Hosting.Lifetime[0] Now listening on: https://192.168.1.4:5051 Microsoft.Hosting.Lifetime: Information: Now listening on: https://192.168.1.4:5051 info: Microsoft.Hosting.Lifetime[0] Application started. Press Ctrl+C to shut down. Microsoft.Hosting.Lifetime: Information: Application started. Press Ctrl+C to shut down. info: Microsoft.Hosting.Lifetime[0] Hosting environment: Development Microsoft.Hosting.Lifetime: Information: Hosting environment: Development info: Microsoft.Hosting.Lifetime[0] Content root path: C:\Projects\dotNetCore-2019\Https-TestCerSalam7\HttpsAPI Microsoft.Hosting.Lifetime: Information: Content root path: C:\Projects\dotNetCore-2019\Https-TestCerSalam7\HttpsAPI
Even when I do
_logger.Log(LogLevel.Debug, "some text");
I get nothing logged/debugged
Of course I have already added the following in program.cs
.ConfigureLogging(logging =>
{
logging.ClearProviders();
logging.SetMinimumLevel(LogLevel.Debug);
logging.AddConsole();
logging.AddDebug();
})
in a controller, using "dotnet run" outputs nothing to console I get get nothing written to console, I get 4 lines as follows:
Microsoft.Hosting.Lifetime: Information: Content root path: C:\Projects\dotNetCore-2019\Https-TestCerSalam7\HttpsAPI Loaded 'c:\program files\dotnet\shared\Microsoft.NETCore.App\5.0.3\System.Security.Principal.Windows.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled. Loaded 'c:\program files\dotnet\shared\Microsoft.NETCore.App\5.0.3\System.Text.RegularExpressions.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled. Loaded 'c:\program files\dotnet\shared\Microsoft.NETCore.App\5.0.3\System.Net.Http.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled. Loaded 'c:\program files\dotnet\shared\Microsoft.NETCore.App\5.0.3\System.Net.WebSockets.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
I googled and searched this site to see if I can disable the option 'Just My Code', I was not successful