Created
September 4, 2021 06:24
-
-
Save mirmostafa/23284bfd5bd69a8eebfd2c0f2d3a2067 to your computer and use it in GitHub Desktop.
Setup logger
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<PackageReference Include="Microsoft.Extensions.Logging.Console" Version="5.0.0" /> | |
<PackageReference Include="Microsoft.Extensions.Logging.Debug" Version="3.1.2" /> | |
<PackageReference Include="Serilog.Extensions.Logging.File" Version="2.0.0" /> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static IWebHostBuilder CreateWebHostBuilder(string[] args) => | |
WebHost.CreateDefaultBuilder(args) | |
.ConfigureLogging(logging => | |
{ | |
logging.ClearProviders(); | |
logging.AddDebug().AddConsole(); | |
logging.AddFilter("", LogLevel.Information) | |
.AddFilter("Microsoft.AspNetCore.Routing.EndpointMiddleware", LogLevel.Warning) | |
.AddFilter("Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker", LogLevel.Warning) | |
.AddFilter("Microsoft.AspNetCore.Mvc.Infrastructure.ObjectResultExecutor", LogLevel.Warning); | |
}) | |
.UseStartup<Startup>() | |
//.UseIIS().UseUrls("http://*:5000"); | |
.UseKestrel(option => option.Listen(IPAddress.Loopback, 5000)); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment