From 33bf88d866ba5513cd01ed947a6edf37c8a2e7f7 Mon Sep 17 00:00:00 2001 From: James Tombleson Date: Mon, 3 Apr 2023 08:57:19 -0700 Subject: [PATCH] Features/discord errors (#21) * catching another http error code. * more discord logging * Setting min logging to debug for now. --- Newsbot.Collector.Api/Program.cs | 5 ++++- Newsbot.Collector.Domain/Consts/ConfigConst.cs | 2 ++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/Newsbot.Collector.Api/Program.cs b/Newsbot.Collector.Api/Program.cs index 4c6292f..27752f6 100644 --- a/Newsbot.Collector.Api/Program.cs +++ b/Newsbot.Collector.Api/Program.cs @@ -7,7 +7,7 @@ using Newsbot.Collector.Domain.Consts; using Newsbot.Collector.Domain.Models; using Newsbot.Collector.Domain.Models.Config; using Serilog; - +using Serilog.Events; using ILogger = Serilog.ILogger; var builder = WebApplication.CreateBuilder(args); @@ -83,14 +83,17 @@ static ILogger GetLogger(IConfiguration configuration) if (otel == "") return Log.Logger = new LoggerConfiguration() .WriteTo.Console() + .MinimumLevel.Debug() .CreateLogger(); return Log.Logger = new LoggerConfiguration() .WriteTo.Console() + .MinimumLevel.Debug() .WriteTo.OpenTelemetry( otel, resourceAttributes: new Dictionary { + { "Application", "newsbot-collector-api"}, { "service.name", "newsbot-collector-api" } }) .CreateLogger(); diff --git a/Newsbot.Collector.Domain/Consts/ConfigConst.cs b/Newsbot.Collector.Domain/Consts/ConfigConst.cs index 3d5ad17..2f4922e 100644 --- a/Newsbot.Collector.Domain/Consts/ConfigConst.cs +++ b/Newsbot.Collector.Domain/Consts/ConfigConst.cs @@ -2,6 +2,8 @@ namespace Newsbot.Collector.Domain.Consts; public class ConfigConst { + public const string LoggingDefault = "Logging:LogLevel:Default"; + public const string SectionConnectionStrings = "ConnectionStrings"; public const string SectionFinalFantasyXiv = "FinalFantasyXiv"; public const string SectionReddit = "Reddit";