serilog configuration changed based on environments
This commit is contained in:
parent
22c0d933af
commit
e8b9fe0dc3
@ -9,13 +9,25 @@ using PortBlog.API.Middleware;
|
||||
using Serilog;
|
||||
using System.Reflection;
|
||||
|
||||
|
||||
|
||||
var builder = WebApplication.CreateBuilder(args);
|
||||
|
||||
if (builder.Environment.IsDevelopment())
|
||||
{
|
||||
Log.Logger = new LoggerConfiguration()
|
||||
.MinimumLevel.Debug()
|
||||
.WriteTo.Console()
|
||||
.WriteTo.File("logs/portblog.txt", rollingInterval: RollingInterval.Day)
|
||||
.CreateLogger();
|
||||
|
||||
var builder = WebApplication.CreateBuilder(args);
|
||||
}
|
||||
else
|
||||
{
|
||||
Log.Logger = new LoggerConfiguration()
|
||||
.MinimumLevel.Information()
|
||||
.WriteTo.File("logs/portblog.txt", rollingInterval: RollingInterval.Day)
|
||||
.CreateLogger();
|
||||
}
|
||||
|
||||
var urls = builder.Configuration.GetSection("Urls");
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user