u
This commit is contained in:
@@ -1,15 +1,10 @@
|
||||
using System.Runtime.InteropServices;
|
||||
using CMSMicroservice.WebApi.Services;
|
||||
using CMSMicroservice.Infrastructure.Persistence;
|
||||
using Microsoft.AspNetCore.Builder;
|
||||
using Microsoft.Extensions.DependencyInjection;
|
||||
using Microsoft.Extensions.Hosting;
|
||||
using Microsoft.AspNetCore.Hosting;
|
||||
using Microsoft.AspNetCore.Server.Kestrel.Core;
|
||||
using Serilog.Core;
|
||||
using Serilog;
|
||||
using Serilog.Sinks.MSSqlServer;
|
||||
using Microsoft.Extensions.Configuration;
|
||||
using System.Reflection;
|
||||
using Microsoft.OpenApi.Models;
|
||||
using CMSMicroservice.WebApi.Common.Behaviours;
|
||||
@@ -17,17 +12,17 @@ using CMSMicroservice.WebApi.Common.Behaviours;
|
||||
var builder = WebApplication.CreateBuilder(args);
|
||||
var levelSwitch = new LoggingLevelSwitch();
|
||||
var logger = new LoggerConfiguration()
|
||||
//.WriteTo.Console()
|
||||
.WriteTo.MSSqlServer(builder.Configuration.GetConnectionString("LogConnection"),
|
||||
sinkOptions: new MSSqlServerSinkOptions
|
||||
{
|
||||
TableName = "LogCMSEvents",
|
||||
SchemaName = "Log",
|
||||
AutoCreateSqlTable = true
|
||||
})
|
||||
/* .WriteTo.Seq("http://localhost:5341",
|
||||
apiKey: "IeEfKjIMoCGLljdp9e7A",
|
||||
controlLevelSwitch: levelSwitch)*/
|
||||
//.WriteTo.Console()
|
||||
//.WriteTo.MSSqlServer(builder.Configuration.GetConnectionString("LogConnection"),
|
||||
// sinkOptions: new MSSqlServerSinkOptions
|
||||
// {
|
||||
// TableName = "LogCMSEvents",
|
||||
// SchemaName = "Log",
|
||||
// AutoCreateSqlTable = true
|
||||
// })
|
||||
.WriteTo.Seq("https://seq.afrino.co",
|
||||
apiKey: "oxpvpUzU1pZxMS4s3Fqq",
|
||||
controlLevelSwitch: levelSwitch)
|
||||
.CreateLogger();
|
||||
builder.Logging.AddSerilog(logger);
|
||||
#if DEBUG
|
||||
|
||||
Reference in New Issue
Block a user