sosedoff / pgweb

Cross-platform client for PostgreSQL databases
https://sosedoff.github.io/pgweb
MIT License
8.47k stars 716 forks source link

Alternative format of log messages #746

Open sskserk opened 2 weeks ago

sskserk commented 2 weeks ago

Dear PgWeb Developers,

is it possible to change the format a log messages? I guess it is fixed for now and is simply based on the fmt.Println

Thank you!

sosedoff commented 2 weeks ago

No, the log format is pretty fixed. What is that you're looking to add to the log?

sskserk commented 2 weeks ago

In my use case I have a requirement to change the logging level. For instance, SQL queries could be logged in trace or debug level, but not as INFO. SQL queries contains parameters, that information could be sensitive.

The application is already dockerized, it would be beneficial to have the log level and format configurable with the env vars.

P/S: I could bring a MR that helps to achieve it.

sosedoff commented 2 weeks ago

Take a look at CLI options here: https://github.com/sosedoff/pgweb/wiki/Usage#cli-options, you may find what you're looking for after all. You can configure the log level and format (json/text).