0

我可以将此标量值转换为接收器内的两个单独的属性吗?

接收器将使用 Marten 将 logevent 作为 json 对象存储在 Postgresql 中。

var sensorInput = new { Latitude = 25, Longitude = 134 };
Log.Information("Test {sensorInput}", sensorInput);

在我的 json 对象中,我想将其存储为两个单独的属性,以便我可以过滤其中一个属性

JsonFormatter 也没有将此对象转换为两个单独的属性。我想存储单独的属性,以便我可以查询这些属性

https://github.com/mdissel/serilog-sinks-marten/blob/master/src/Serilog.Sinks.Marten/LogMessage.cs

4

1 回答 1

0

确认的!使用消息中的@ 将属性转换为字典。

于 2017-04-01T09:23:01.767 回答