serilog-sinks-mssqlserver icon indicating copy to clipboard operation
serilog-sinks-mssqlserver copied to clipboard

Default value for additional sql columns in the table.

Open apppoint-release opened this issue 5 years ago • 5 comments

Feature request - Is there a way to set default value for additional columns?. It only supports referencing property names, but in some cases, we want to have additional columns with default values in order to fulfill other operational or integration requirements.

apppoint-release avatar Oct 10 '20 11:10 apppoint-release

Hi and thanks for your request.

I will consider this feature but cannot make any promise right now. In the meantime, we are always open for a good pull requests. :)

ckadluba avatar Oct 19 '20 15:10 ckadluba

Can you tell me a bit more about the operational and integrational requirements you are dealing with? Is there an existing database with non-nullable columns that have no default values set in the database?

ckadluba avatar Oct 30 '20 07:10 ckadluba

Can you tell me a bit more about the operational and integrational requirements you are dealing with? Is there an existing database with non-nullable columns that have no default values set in the database?

Yes, some of the columns are not null without default values in the db schema, logs are split based on the logger namespace into multiple tables using filter conditions. In some cases, we need default values to be set for non null columns. Hope this information helps.

apppoint-release avatar Oct 30 '20 09:10 apppoint-release

anyone find a way to do this? We want a centralized pool of logs for a few internal apps and want a custom column to default to the site name.

TaylorWatson avatar May 03 '22 20:05 TaylorWatson

Please take a look at Serilog Enrichers. This way you can set log properties to default values, or to values based on context (e.g. site name).

ckadluba avatar May 03 '22 22:05 ckadluba