I have the very same problem showed by another SO user: .Net Core SonarQube - Make sure the logger's configuration is safe
SonarQube is showing the message "make sure that this logger's configuration is safe"
but in my case I'm using the MSSqlServer sink.
I can't find a way to add the DisableSensitiveInformationLogging() method to the logger's configuration as shown in the other post. It seems it is not present in the Sql Server sink. I'm using the Serilog.Sinks.MSSqlServer v5.7.0
Here there is my configuration:
Log.Logger = new LoggerConfiguration()
.MinimumLevel.Warning()
.MinimumLevel.Override("Microsoft", LogEventLevel.Warning)
.Enrich.FromLogContext()
.WriteTo
.MSSqlServer(
connectionString: builder.Configuration.GetConnectionString("SerilogConnectionString"),
sinkOptions: new MSSqlServerSinkOptions { TableName = "Logs", AutoCreateSqlTable = true, SchemaName = "dbo" },
columnOptions: new ColumnOptions()
{
AdditionalColumns = new Collection<SqlColumn>()
{
new SqlColumn { DataType = SqlDbType.NVarChar, ColumnName = "AppName", AllowNull = true },
new SqlColumn { DataType = SqlDbType.NVarChar, ColumnName = "SessionId", AllowNull = true },
new SqlColumn { DataType = SqlDbType.NVarChar, ColumnName = "UserId", AllowNull = true },
new SqlColumn { DataType = SqlDbType.NVarChar, ColumnName = "ControllerName", AllowNull = true },
new SqlColumn { DataType = SqlDbType.NVarChar, ColumnName = "ActionName", AllowNull = true }
}
})
.CreateLogger();
I tried to look for the DisableSensitiveInformationLogging in the documentation and googling it, but no luck
Does anybody have a solution for this? Thank you