Newsbot.Collector/Newsbot.Collector.Services/Jobs/JobLogger.cs
James Tombleson adb4799206
Features/missing files (#14)
* Added jobs Controller to trigger collection.

* Added backgroundjobs to move them out of program.cs

* new column to track youtube ID values and adding a sourceid column on the icon for linking

* Added icon table repo

* added interface for IconsRepo

* hey the missing config models

* adding section const keys to pull blocks of configs

* Added youtubewatcher to the code but not ready to enable it in the background.  More testing needed.

* Test... improvements?
2023-03-31 23:00:15 -07:00

22 lines
702 B
C#

using Serilog;
namespace Newsbot.Collector.Services.Jobs;
public static class JobLogger
{
public static ILogger GetLogger(string connectionString, string jobName)
{
if (connectionString == "")
return Log.Logger = new LoggerConfiguration().WriteTo.Console().CreateLogger();
return Log.Logger = new LoggerConfiguration()
.WriteTo.Console()
.WriteTo.OpenTelemetry(
connectionString,
resourceAttributes: new Dictionary<string, object>
{
{ "service.name", "newsbot-collector-api" },
{ "Job", jobName }
})
.CreateLogger();
}
}