added postgres logging, tested