From e90067802f79eb0f31a87a3fa63455dc88a4cd89 Mon Sep 17 00:00:00 2001 From: Natalia Portillo Date: Sat, 21 Jun 2025 11:48:54 +0100 Subject: [PATCH] Add Serilog, with sink to console in debug. --- Aaru.Server/Aaru.Server.csproj | 3 ++ Aaru.Server/Program.cs | 5 ++- Directory.Packages.props | 63 ++++++++++++++++++---------------- 3 files changed, 40 insertions(+), 31 deletions(-) diff --git a/Aaru.Server/Aaru.Server.csproj b/Aaru.Server/Aaru.Server.csproj index 1d7de289..4c42df18 100644 --- a/Aaru.Server/Aaru.Server.csproj +++ b/Aaru.Server/Aaru.Server.csproj @@ -18,6 +18,9 @@ + + + diff --git a/Aaru.Server/Program.cs b/Aaru.Server/Program.cs index d68bb8a4..ce1702ce 100644 --- a/Aaru.Server/Program.cs +++ b/Aaru.Server/Program.cs @@ -6,6 +6,7 @@ using Aaru.Server.Services; using Microsoft.AspNetCore.Components.Authorization; using Microsoft.AspNetCore.Identity; using Microsoft.EntityFrameworkCore; +using Serilog; using DbContext = Aaru.Server.Database.DbContext; using Version = System.Version; @@ -65,7 +66,9 @@ Console.WriteLine("\e[31;1mBuilding web application...\e[0m"); WebApplicationBuilder builder = WebApplication.CreateBuilder(args); -builder.Logging.AddConsole(); +#if DEBUG +builder.Logging.AddSerilog(new LoggerConfiguration().WriteTo.Console().CreateLogger()); +#endif // Add services to the container. builder.Services.AddRazorComponents().AddInteractiveServerComponents(); diff --git a/Directory.Packages.props b/Directory.Packages.props index 1f420364..bde39dc9 100644 --- a/Directory.Packages.props +++ b/Directory.Packages.props @@ -1,34 +1,37 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file