Logs all visited source elements to a database.