-
Notifications
You must be signed in to change notification settings - Fork 17
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
PropertiesColumnWriter: ability to exclude specified properties #21
Comments
This ability would be a welcome addition out-of-the-box. I had the same need. Utilized manisero's solution. |
You could use my new project which is basically the same as this repo but will be better maintained: https://github.com/SeppPenner/SerilogSinkForPostgreSQL. Don't hesitate to put this pull request to my repository, too. |
@nilmas @manisero: What's the benefit of this? I mean, isn't it possible to simply exclude a property from the Dictionary? From IDictionary<string, ColumnWriterBase> columnWriters = new Dictionary<string, ColumnWriterBase>
{
{ "message", new RenderedMessageColumnWriter(NpgsqlDbType.Text) },
{ "message_template", new MessageTemplateColumnWriter(NpgsqlDbType.Text) },
{ "level", new LevelColumnWriter(true, NpgsqlDbType.Varchar) },
{ "raise_date", new TimestampColumnWriter(NpgsqlDbType.Timestamp) },
{ "exception", new ExceptionColumnWriter(NpgsqlDbType.Text) }
}; to e.g.: IDictionary<string, ColumnWriterBase> columnWriters = new Dictionary<string, ColumnWriterBase>
{
{ "message", new RenderedMessageColumnWriter(NpgsqlDbType.Text) },
{ "message_template", new MessageTemplateColumnWriter(NpgsqlDbType.Text) },
{ "raise_date", new TimestampColumnWriter(NpgsqlDbType.Timestamp) },
{ "exception", new ExceptionColumnWriter(NpgsqlDbType.Text) }
}; ? I am planning to bring this feature to my project so you can use it. Check serilog-contrib/Serilog.Sinks.Postgresql.Alternative#8. I will release a new version tomorrow probably. |
I would like to store LogEvent's properties, but not all of them.
E.g. I store some properties as separate columns using SinglePropertyColumnWriter and I don't want to duplicate them in "properties" column:
Giving PropertiesColumnWriter an ability exclude specified properties would solve the issue:
The text was updated successfully, but these errors were encountered: