Default value for additional sql columns in the table.
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.
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. :)
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?
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.
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.
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).