add a logger to script. initialize sql at startup