started logging query length and time spent

Not sure if time spent has been logged in the best way but good for
practice anyway