Benjamin Fan
2020/3/6
Simple, Scalar Values
var count = 456;
Log.Information("Retrieved {Count} records", count);
Collections
var fruit = new[] { "Apple", "Pear", "Orange" };
Log.Information("In my bowl I have {Fruit}", fruit);
Collections
var fruit = new Dictionary<string,int> {{ "Apple", 1}, { "Pear", 5 }};
Log.Information("In my bowl I have {Fruit}", fruit);
Objects
var position = new { Latitude = 25, Longitude = 134 };
Log.Logger.Warning("Processed {@Position}", position);
// 02:34:23 [AppId:{ Id = 1, Name = BenBen } WRN] Processed {"Latitude": 25, "Longitude": 134}
There are so many sinks you can find here: