Refactored out the whole config into a function, with logging level and logging strategy set with parameters.