improve metrics logger