using Microsoft.Extensions.DependencyInjection;
|
using System;
|
using System.Collections.Generic;
|
using System.Linq;
|
using System.Text;
|
using System.Threading.Tasks;
|
|
namespace FlexJobApi.Core
|
{
|
public class LogServiceComponent : IServiceComponent
|
{
|
public void Load(IServiceCollection services, ComponentContext componentContext)
|
{
|
services.AddConsoleFormatter(options =>
|
{
|
options.WithTraceId = true;
|
});
|
|
services.AddFileLogging(options =>
|
{
|
options.WithTraceId = true;
|
options.FileNameRule = fileName =>
|
{
|
return string.Format(fileName, DateTime.Now);
|
};
|
});
|
|
//services.AddDatabaseLogging<DatabaseLoggingWriter>(options =>
|
//{
|
// options.WithTraceId = true;
|
//});
|
}
|
}
|
}
|