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

This nuget requires adding the CREATE privilege on schema level #26

Closed Mikilll94 closed 3 years ago

Mikilll94 commented 3 years ago

I wanted to prepare my database for production. I have noticed that If you will not add the CREATE privilege on schema level, the logging will just not work. Of course I am assuming that the user which is connecting to the database is not a superuser.

Additionally this nugget does not produce any logs or debug info. I had to spend hours on debugging to figure out what is going on.

SeppPenner commented 3 years ago

I have noticed that If you will not add the CREATE privilege on schema level, the logging will just not work. Of course I am assuming that the user which is connecting to the database is not a superuser.

Which options did you set in the configuration? Normally, this can be solved by adding the database before the setup and setting the options needAutoCreateTable and needAutoCreateSchema to false.

Additionally this nugget does not produce any logs or debug info. I had to spend hours on debugging to figure out what is going on.

You should be able to get log message by using the failureCallback.

Check https://github.com/SeppPenner/SerilogSinkForPostgreSQL/blob/master/HowToUse.md, please.

Mikilll94 commented 3 years ago

@SeppPenner Thanks. I was using an older version and I didn't know about needAutoCreateSchema and failureCallback. Now everything is working fine.

SeppPenner commented 3 years ago

Ok, great. The features were added recently (Especially needAutoCreateSchema) after someone complained about the same thing as you did :) Glad to hear that it works, I already thought that there is an issue with that mechanism.