Features/discord errors (#21)

* catching another http error code.

* more discord logging

* Setting min logging to debug for now.
This commit is contained in:
James Tombleson 2023-04-03 08:57:19 -07:00 committed by GitHub
parent af2f700e41
commit 33bf88d866
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 1 deletions

View File

@ -7,7 +7,7 @@ using Newsbot.Collector.Domain.Consts;
using Newsbot.Collector.Domain.Models; using Newsbot.Collector.Domain.Models;
using Newsbot.Collector.Domain.Models.Config; using Newsbot.Collector.Domain.Models.Config;
using Serilog; using Serilog;
using Serilog.Events;
using ILogger = Serilog.ILogger; using ILogger = Serilog.ILogger;
var builder = WebApplication.CreateBuilder(args); var builder = WebApplication.CreateBuilder(args);
@ -83,14 +83,17 @@ static ILogger GetLogger(IConfiguration configuration)
if (otel == "") if (otel == "")
return Log.Logger = new LoggerConfiguration() return Log.Logger = new LoggerConfiguration()
.WriteTo.Console() .WriteTo.Console()
.MinimumLevel.Debug()
.CreateLogger(); .CreateLogger();
return Log.Logger = new LoggerConfiguration() return Log.Logger = new LoggerConfiguration()
.WriteTo.Console() .WriteTo.Console()
.MinimumLevel.Debug()
.WriteTo.OpenTelemetry( .WriteTo.OpenTelemetry(
otel, otel,
resourceAttributes: new Dictionary<string, object> resourceAttributes: new Dictionary<string, object>
{ {
{ "Application", "newsbot-collector-api"},
{ "service.name", "newsbot-collector-api" } { "service.name", "newsbot-collector-api" }
}) })
.CreateLogger(); .CreateLogger();

View File

@ -2,6 +2,8 @@ namespace Newsbot.Collector.Domain.Consts;
public class ConfigConst public class ConfigConst
{ {
public const string LoggingDefault = "Logging:LogLevel:Default";
public const string SectionConnectionStrings = "ConnectionStrings"; public const string SectionConnectionStrings = "ConnectionStrings";
public const string SectionFinalFantasyXiv = "FinalFantasyXiv"; public const string SectionFinalFantasyXiv = "FinalFantasyXiv";
public const string SectionReddit = "Reddit"; public const string SectionReddit = "Reddit";