Merge "ExternalInputLogging: refine the logic of getting the input id used for logging" into main