More advance way of replacing log handlers