Add logging and automatic creation of postgres DB