serilog-contrib / Serilog.Sinks.Postgresql.Alternative

Serilog.Sinks.Postgresql.Alternative is a library to save logging information from https://github.com/serilog/serilog to https://www.postgresql.org/.
MIT License
67 stars 13 forks source link

AuditSink for PostgreSQL #28

Closed bliusb closed 3 years ago

bliusb commented 3 years ago

This is Bingkun Li from TerumoBCT. We added the Auditsink functionality for your SerilogSinkForPostgreSQL. We would like to create a PR for this change. Would this be ok with you? Also do we need to upload nuget package as well? Thanks.

SeppPenner commented 3 years ago

Hi Bingkun. That would be a great feature. If you like to, just create your pull request and tell me when you're done. I will check it and merge it afterwards :)

bliusb commented 3 years ago

Thank you Hans (SeppPenner). We are getting together for a pull request. A couple of notes here:

  1. we added or append 'copyright' info with "TerumoBCT' to the files we added or changed. let me know if this is ok or not. a. SerilogSinkForPostgreSQL\src\SerilogSinksPostgreSQL\Sinks\PostgreSQL\PostgreSQLAuditSink.cs (new) b. SerilogSinkForPostgreSQL\src\SerilogSinksPostgreSQL\LoggerConfigurationPostgreSQLExtensions.cs (changed) c. SerilogSinksPostgreSQL.IntegrationTests\DbWriteTests and DbWriteWithSchemaTests (changed)
  2. We also add ''using Serilog.Sinks.PostgreSQL.ColumnWriters;" to the files in SerilogSinksPostgreSQL.Tests project to make it build. So we also include them in this pull request. Note this is not part of this auditsink feature, but just make the solution build. If these 'using' are unnecessary, please feel free to not merge these files in in SerilogSinksPostgreSQL.Tests .

Regards, Bingkun

bliusb commented 3 years ago

Hi Hans, I have created a pull request (https://github.com/SeppPenner/SerilogSinkForPostgreSQL/pull/29). However, there are some Conflicting files: src/SerilogSinksPostgreSQL.Tests/ColumnWritersTests/ExceptionColumnWriterTest.cs src/SerilogSinksPostgreSQL.Tests/ColumnWritersTests/IdAutoincrementColumnWriterTest.cs src/SerilogSinksPostgreSQL.Tests/ColumnWritersTests/LevelColumnWriterTest.cs src/SerilogSinksPostgreSQL.Tests/ColumnWritersTests/PropertiesColumnWriterTest.cs src/SerilogSinksPostgreSQL.Tests/ColumnWritersTests/SinglePropertyColumnWriterTest.cs src/SerilogSinksPostgreSQL.Tests/ColumnWritersTests/TimestampColumnWriterTest.cs

I just noticed that you have some re-works after I forked this repo. So I am undoing the changes i made (as I mentioned in last message #2) to these six files. Now all checks have passed. Please let me know if you have any comments or this would be able to merge.

bliusb commented 3 years ago

Hello Hans, Do you have any chance to check this PR out? Thanks Bingkun

SeppPenner commented 3 years ago

I'm at it at the moment.

SeppPenner commented 3 years ago

I was confused about some of your changes, now I understand the issues. I have adjusted some things in the sink after you added your stuff.

bliusb commented 3 years ago

Sorry about the confusion. Yes, I forked the repo before you reworked some tests. When I tried to build the forked one from Visual Studio, I saw some build errors but added 'using Serilog.Sinks.PostgreSQL.ColumnWriters' to the tests to fix it. When I created the pull request, there were some conflicts. So I removed my these 'using', this resolved the conflicts. Feel free to make changes. Thanks

SeppPenner commented 3 years ago

I will make some changes, it's merged and will be available from the next release on, I guess.

bliusb commented 3 years ago

Thanks. The tests may need some changes per your recent work. I have just pushed some changes to the master branch of my forked repo. you could take a look.

Also when you could make a nuget package available for us to use?

SeppPenner commented 3 years ago

Yeah, I have done the changes already. I hope that it still works as desired. The new nuget package should be available soon.

bliusb commented 3 years ago

Great! Just let me know if the new nuget package is available. Thank you very much.

SeppPenner commented 3 years ago

It should have been available from yesterday already but something went wrong. It's online now.

bliusb commented 3 years ago

I see the new nupkg 3.3.1. Thank you!