Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Default value for additional sql columns in the table. #318

Open
apppoint-release opened this issue Oct 10, 2020 · 5 comments
Open

Default value for additional sql columns in the table. #318

apppoint-release opened this issue Oct 10, 2020 · 5 comments

Comments

@apppoint-release
Copy link

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.

@ckadluba
Copy link
Member

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
Copy link
Member

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?

@apppoint-release
Copy link
Author

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.

@TaylorWatson
Copy link

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.

@ckadluba
Copy link
Member

ckadluba commented May 3, 2022

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).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants