setup logging handlers in separate function