Add functions to log trust query results handled by the TID server
Move external logging to its own file
Change invocation to fit new API