Serilog updates

master
Tudor Stanciu 2021-11-13 21:54:08 +02:00
parent b3eecbff77
commit 958a8499f8
4 changed files with 11 additions and 8 deletions

View File

@ -39,12 +39,15 @@ namespace IdentityServer.Api
columnOptions.Store.Remove(StandardColumn.Properties); columnOptions.Store.Remove(StandardColumn.Properties);
columnOptions.Store.Remove(StandardColumn.MessageTemplate); columnOptions.Store.Remove(StandardColumn.MessageTemplate);
columnOptions.Store.Add(StandardColumn.LogEvent); columnOptions.Store.Add(StandardColumn.LogEvent);
var mssqlSinkOptions = new MSSqlServerSinkOptions() { AutoCreateSqlTable = true, TableName = "__Logs" };
Log.Logger = new LoggerConfiguration() Log.Logger = new LoggerConfiguration()
.MinimumLevel.ControlledBy(loggingLevelSwitch) .MinimumLevel.ControlledBy(loggingLevelSwitch)
.MinimumLevel.Override("Microsoft", LogEventLevel.Warning) .MinimumLevel.Override("Microsoft", LogEventLevel.Warning)
.Enrich.FromLogContext() .Enrich.FromLogContext()
.WriteTo.Console() .WriteTo.Console()
.WriteTo.MSSqlServer(connectionString, "__Logs", autoCreateSqlTable: true, columnOptions: columnOptions) .WriteTo.MSSqlServer(connectionString, mssqlSinkOptions, columnOptions: columnOptions)
.CreateLogger(); .CreateLogger();
try try

View File

@ -2,7 +2,7 @@
# chmod u+x build-amd64.sh # chmod u+x build-amd64.sh
echo "Welcome!" echo "Welcome!"
version="1.0.0" version="1.0.1-alpha1"
localRegistryPass="***REMOVED***" localRegistryPass="***REMOVED***"
echo "Create docker image with version $version." echo "Create docker image with version $version."

View File

@ -1,10 +1,10 @@
<Project> <Project>
<PropertyGroup Label="Package Versions"> <PropertyGroup Label="Package Versions">
<MicrosoftExtensionsPackageVersion>3.1.3</MicrosoftExtensionsPackageVersion> <MicrosoftExtensionsPackageVersion>3.1.8</MicrosoftExtensionsPackageVersion>
<SerilogPackageVersion>3.2.0</SerilogPackageVersion> <SerilogPackageVersion>4.1.0</SerilogPackageVersion>
<SerilogExtensionsPackageVersion>3.0.1</SerilogExtensionsPackageVersion> <SerilogExtensionsPackageVersion>3.1.0</SerilogExtensionsPackageVersion>
<SerilogSinksConsolePackageVersion>3.1.1</SerilogSinksConsolePackageVersion> <SerilogSinksConsolePackageVersion>4.0.0</SerilogSinksConsolePackageVersion>
<SerilogSinksMSSqlServerPackageVersion>5.2.0</SerilogSinksMSSqlServerPackageVersion> <SerilogSinksMSSqlServerPackageVersion>5.6.1</SerilogSinksMSSqlServerPackageVersion>
<AutoMapperPackageVersion>9.0.0</AutoMapperPackageVersion> <AutoMapperPackageVersion>9.0.0</AutoMapperPackageVersion>
<AutoMapperExtensionsPackageVersion>7.0.0</AutoMapperExtensionsPackageVersion> <AutoMapperExtensionsPackageVersion>7.0.0</AutoMapperExtensionsPackageVersion>
<MediatRPackageVersion>6.0.0</MediatRPackageVersion> <MediatRPackageVersion>6.0.0</MediatRPackageVersion>

View File

@ -1,7 +1,7 @@
#!/bin/sh #!/bin/sh
echo "Welcome!" echo "Welcome!"
version="1.0.0" version="1.0.1"
oldver="1.0.0" oldver="1.0.0"
echo "Pull docker image identity-server:$version from registry." echo "Pull docker image identity-server:$version from registry."