how to initialize DB for logging.