imporved logging performance