Added postgresql logging and log report creation