First working version of the logger with db connectivity