Closed avelinoruiz closed 4 years ago
Hi @avelinoruiz. Thanks for getting in touch and sorry for the late answer.
The sink maps custom properties always to database columns of the same name. Unfortunately there is no way to map them to a column with a name that differs from the property name.
You could define a Serilog enricher for your MachineName property and provide the value in that enricher.
A small update on this.
This issue is a duplicate of issue #182 and since there seems to be some demand for this enhancement, we have now plans to implement it.
Hello,
I am using Serilog to log events to a mssqlserver table that has a different column's name than the property's.
How can I map the following property to the column "machineName" defined in a table?
LogEventProperty("hostName", new ScalarValue(Environment.MachineName))
Thank you
If you are opening a feature request, you can ignore this template. Bug reports and requests for assistance usually require the same basic information described below. This will help us more quickly reproduce and investigate the problem you're reporting. (If you are using Serilog.Sinks.MSSqlServerCore, that package is deprecated, please switch to Serilog.Sinks.MSSqlServer before reporting an issue.)
[ ] .NET Core 2.0 [ ] .NET Framework 4.7 [ ] .NET Framework 4.6.x [ ] .NET Framework 4.5.x OS: