Add logging
Add pgsql connection