I'm using Serilog.Sinks.PostgresqlNuget
package to write lon
inside the PostgreSQL
but its not writing any log
IDictionary<string, ColumnWriterBase> columnWriters = new Dictionary<string, ColumnWriterBase>
{
{"message", new RenderedMessageColumnWriter()},
{"message_template", new MessageTemplateColumnWriter() },
{"level", new LevelColumnWriter(true, NpgsqlDbType.Varchar) },
{"raise_date", new TimeStampColumnWriter() },
{"exception", new ExceptionColumnWriter() },
{"properties", new LogEventSerializedColumnWriter() },
{"props_test", new PropertiesColumnWriter(NpgsqlDbType.Text) },
{"machine_name", new SinglePropertyColumnWriter("MachineName", PropertyWriteMethod.Raw) }
};
I am glad to say that i fond the issue It was because of additional column which i have added in my table (Id Auto increment) https://www.symbolsource.org/Public/Metadata/NuGet/Project/Npgsql/3.0.0-beta0001/Release/.NETFramework,Version%3Dv4.5/Npgsql/Npgsql/NpgsqlBinaryImporter.cs?ImageName=Npgsql Now its working fine for me