HaemmerElectronics.SeppPenner.SerilogSinkForPostgreSQL
1.0.0
Prefix Reserved
See the version list below for details.
dotnet add package HaemmerElectronics.SeppPenner.SerilogSinkForPostgreSQL --version 1.0.0
NuGet\Install-Package HaemmerElectronics.SeppPenner.SerilogSinkForPostgreSQL -Version 1.0.0
<PackageReference Include="HaemmerElectronics.SeppPenner.SerilogSinkForPostgreSQL" Version="1.0.0" />
paket add HaemmerElectronics.SeppPenner.SerilogSinkForPostgreSQL --version 1.0.0
#r "nuget: HaemmerElectronics.SeppPenner.SerilogSinkForPostgreSQL, 1.0.0"
// Install HaemmerElectronics.SeppPenner.SerilogSinkForPostgreSQL as a Cake Addin #addin nuget:?package=HaemmerElectronics.SeppPenner.SerilogSinkForPostgreSQL&version=1.0.0 // Install HaemmerElectronics.SeppPenner.SerilogSinkForPostgreSQL as a Cake Tool #tool nuget:?package=HaemmerElectronics.SeppPenner.SerilogSinkForPostgreSQL&version=1.0.0
SerilogSinkForPostgreSQL
SerilogSinkForPostgreSQL is a library to save logging information from Serilog to PostgreSQL. The assembly was written and tested in .Net 4.7.2, ASP.NetCore 2.2 and NetStandard 2.0.
Basic usage:
string connectionString = "User ID=serilog;Password=serilog;Host=localhost;Port=5432;Database=logs";
string tableName = "logs";
//Used columns (Key is a column name)
//Column type is writer's constructor parameter
IDictionary<string, ColumnWriterBase> columnWriters = new Dictionary<string, ColumnWriterBase>
{
{"message", new RenderedMessageColumnWriter(NpgsqlDbType.Text) },
{"message_template", new MessageTemplateColumnWriter(NpgsqlDbType.Text) },
{"level", new LevelColumnWriter(true, NpgsqlDbType.Varchar) },
{"raise_date", new TimestampColumnWriter(NpgsqlDbType.Timestamp) },
{"exception", new ExceptionColumnWriter(NpgsqlDbType.Text) },
{"properties", new LogEventSerializedColumnWriter(NpgsqlDbType.Jsonb) },
{"props_test", new PropertiesColumnWriter(NpgsqlDbType.Jsonb) },
{"machine_name", new SinglePropertyColumnWriter("MachineName", PropertyWriteMethod.ToString, NpgsqlDbType.Text, "l") }
};
var logger = new LoggerConfiguration()
.WriteTo.PostgreSQL(connectionString, tableName, columnWriters)
.CreateLogger();
The project can be found on nuget.
Table auto creation
If you set parameter needAutoCreateTable
to true
sink automatically create table.
You can change column sizes by setting values in TableCreator
class:
//Sets size of all BIT and BIT VARYING columns to 20
TableCreator.DefaultBitColumnsLength = 20;
//Sets size of all CHAR columns to 30
TableCreator.DefaultCharColumnsLength = 30;
//Sets size of all VARCHAR columns to 50
TableCreator.DefaultVarcharColumnsLength = 50;
Available on
.NetFramework 4.7.2 Package - Serilog.Sinks.PostgreSQL | Platforms - .NET 4.5, .NET Standard 2.0
Change history
- Version 1.0.0.0 (2019-02-22) : 1.0 release.
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net5.0 was computed. net5.0-windows was computed. net6.0 was computed. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 was computed. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 was computed. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. net9.0 was computed. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. |
.NET Core | netcoreapp2.0 was computed. netcoreapp2.1 was computed. netcoreapp2.2 was computed. netcoreapp3.0 was computed. netcoreapp3.1 was computed. |
.NET Standard | netstandard2.0 is compatible. netstandard2.1 was computed. |
.NET Framework | net461 was computed. net462 was computed. net463 was computed. net47 was computed. net471 was computed. net472 is compatible. net48 was computed. net481 was computed. |
MonoAndroid | monoandroid was computed. |
MonoMac | monomac was computed. |
MonoTouch | monotouch was computed. |
Tizen | tizen40 was computed. tizen60 was computed. |
Xamarin.iOS | xamarinios was computed. |
Xamarin.Mac | xamarinmac was computed. |
Xamarin.TVOS | xamarintvos was computed. |
Xamarin.WatchOS | xamarinwatchos was computed. |
This package has no dependencies.
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
Version | Downloads | Last updated | |
---|---|---|---|
3.3.7 | 155,655 | 8/29/2021 | |
3.3.6 | 4,913 | 8/9/2021 | |
3.3.5 | 1,370 | 7/25/2021 | |
3.3.4 | 31,958 | 6/4/2021 | |
3.3.3 | 10,159 | 4/29/2021 | |
3.3.2 | 27,537 | 3/4/2021 | |
3.3.1 | 2,682 | 3/4/2021 | |
3.3.0 | 1,836 | 2/21/2021 | |
3.2.4 | 143 | 2/21/2021 | |
3.2.3 | 5,955 | 1/14/2021 | |
3.2.2 | 1,863 | 1/4/2021 | |
3.2.1 | 469 | 1/3/2021 | |
3.2.0 | 541 | 12/26/2020 | |
3.1.0 | 1,230 | 11/16/2020 | |
3.0.0 | 2,455 | 11/11/2020 | |
2.5.0 | 782 | 10/13/2020 | |
2.4.1 | 209 | 10/13/2020 | |
2.4.0 | 4,507 | 9/6/2020 | |
2.3.1 | 279 | 9/6/2020 | |
2.3.0 | 586 | 9/6/2020 | |
2.2.0 | 7,451 | 7/25/2020 | |
2.1.0 | 130,345 | 6/30/2020 | |
2.0.0 | 1,191 | 6/16/2020 | |
1.9.0 | 548 | 6/16/2020 | |
1.8.1 | 569 | 6/5/2020 | |
1.7.0 | 7,508 | 5/10/2020 | |
1.6.0 | 8,863 | 3/26/2020 | |
1.5.0 | 12,692 | 2/9/2020 | |
1.0.4 | 13,268 | 11/8/2019 | |
1.0.3 | 1,032 | 6/23/2019 | |
1.0.2 | 707 | 5/13/2019 | |
1.0.1 | 640 | 5/12/2019 | |
1.0.0 | 636 | 2/22/2019 |
Version 1.0.0.0 (2019-02-22)** : 1.0 release.