The Audit Log can actually give you that information already. If you audit Login and Logout events you can then use SQL to see what's going on in the system. Here's a query to get started (in the %SYS namespace):
SELECT UTCTimeStamp,Username,Event
FROM %SYS.Audit- Log in to post comments