请参阅https://github.com/b00ted/serilog-sinks-postgresql。 任何人都可以将该示例中的connectionstring,tableName和columnWriters属性重写为appsettings.json语法吗? columnWriters属性对我来说是一个最大的问题。感谢。
这样的事情:
{
"Serilog": {
"Using": [
"Serilog.Sinks.Postgresql"
],
"MinimumLevel": "Information",
"WriteTo": [
{
"Name": "PostgreSQL",
"Args": {
"connectionString": "Data Source=(local); Initial Catalog=Test;User ID=sa;Password=Passwd@12;",
"tableName": "logs",
"columnOptions": Place for columnWriters property...
}
}
]
}
}