Factored out logfile handler configuration into it's own reusable function.