Update log formatting based on index