James Tombleson
adb4799206
* 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?
22 lines
702 B
C#
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();
|
|
}
|
|
} |