mirror of
https://github.com/Govor-team/Govor.git
synced 2026-07-21 19:54:55 +00:00
new logger
This commit is contained in:
@@ -0,0 +1,17 @@
|
||||
using Serilog;
|
||||
|
||||
namespace Govor.API.Extensions;
|
||||
|
||||
public static class ConfiguratorLoggerExtensions
|
||||
{
|
||||
public static void AddLogger(this WebApplicationBuilder builder)
|
||||
{
|
||||
Log.Logger = new LoggerConfiguration()
|
||||
.MinimumLevel.Information()
|
||||
.WriteTo.Console()
|
||||
.WriteTo.File("Logs/log-.txt", rollingInterval: RollingInterval.Day) // Лог в файл, ежедневно
|
||||
.CreateLogger();
|
||||
|
||||
builder.Host.UseSerilog();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user