Clean up and make resusable the logging configuration