Log database errors
Previously all PG::ConnectionBad
errors were quietly swallowed. We now
pass along a logger so that we can see when these errors occur. For example:
2020-07-03_00:14:18.42120 E, [2020-07-02T19:14:18.421063 #17532] ERROR -- : Error connecting to the database: could not connect to server: Connection refused
2020-07-03_00:14:18.42122 Is the server running on host "10.138.0.7" and accepting
2020-07-03_00:14:18.42123 TCP/IP connections on port 5432?
2020-07-03_00:14:18.42123
Closes https://gitlab.com/gitlab-org/gitlab-exporter/-/issues/72
Edited by Stan Hu