Format time in logger