Add some logs to IdGenerator and fix a bug of it.