MDL-14591 - added some phpdocs, moved the transfer log insert into its own method...