How to get login username of the login that triggerred a task in the task scheduler

It's not ideal, but you could have a separate task that just writes the username to a log file at the same time, and correlate the logs later. For that matter, since the task runs at login, this information is already available in the event logs. If you're really desparate to not correlate these later, you could add code (or a step) to the existing task to pull the most recent login event.

Login Event Log

Looking through my own logs a little more closely, I see you want Event ID 4624, but only where the Logon Type is 2 or 7. I saw a number of Logon Type 5 events for system accounts doing various things. There's more info here:

http://www.windowsecurity.com/articles-tutorials/misc_network_security/Logon-Types.html