This commit is contained in:
MeysamMoghaddam
2025-09-27 10:51:57 +03:30
parent 0e32dc9359
commit 5340517546
11 changed files with 146 additions and 29 deletions

View File

@@ -1,12 +1,10 @@
using System.Reflection;
using System.Runtime.InteropServices;
using Microsoft.AspNetCore.Hosting;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.AspNetCore.Server.Kestrel.Core;
using Serilog;
using Serilog.Core;
using Serilog.Sinks.MSSqlServer;
using Microsoft.OpenApi.Models;
var builder = WebApplication.CreateBuilder(args);
@@ -22,17 +20,17 @@ if (RuntimeInformation.IsOSPlatform(OSPlatform.OSX))
var levelSwitch = new LoggingLevelSwitch();
var logger = new LoggerConfiguration()
//.WriteTo.Console()
.WriteTo.MSSqlServer(builder.Configuration.GetConnectionString("LogConnection"),
sinkOptions: new MSSqlServerSinkOptions
{
TableName = "Log_FrontOffice_BFF_WebApi_Events",
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 = "Log_FrontOffice_BFF_WebApi_Events",
// SchemaName = "Log",
// AutoCreateSqlTable = true
// })
.WriteTo.Seq("https://seq.afrino.co",
apiKey: "w1eNj67IhxlmKa5WG2ov",
controlLevelSwitch: levelSwitch)
.CreateLogger();
builder.Logging.AddSerilog(logger);
#if DEBUG

View File

@@ -0,0 +1,12 @@
{
"profiles": {
"FrontOffice.BFF.WebApi": {
"commandName": "Project",
"launchBrowser": true,
"environmentVariables": {
"ASPNETCORE_ENVIRONMENT": "Development"
},
"applicationUrl": "https://localhost:34781;http://localhost:34782"
}
}
}

View File

@@ -1,16 +1,16 @@
{
"JwtSecurityKey": "TvlZVx5TJaHs8e9HgUdGzhGP2CIidoI444nAj+8+g7c=",
"JwtIssuer": "https://localhost",
"JwtAudience": "https://localhost",
"JwtExpiryInDays": 365,
"AllowedHosts": "*",
"Kestrel": {
"EndpointDefaults": {
"Protocols": "Http2"
}
},
"ConnectionStrings": {
"LogConnection": "Data Source=.,2019; Initial Catalog=DBName;User ID=dbuser;Password=dbpassword;Connection Timeout=300000;MultipleActiveResultSets=True;Encrypt=False",
"providerName": "System.Data.SqlClient"
},
}
"GrpcChannelOptions": {
//"FileManagementMSAddress": "https://localhost:31307"
"CMSMSAddress": "https://localhost:32846"
},
"Authentication": {
"Authority": "https://ids.domain.com/",