From Middle English logge, logg (since 14th century, while its Anglo-Latin derivatives are attested since early 13th century), of Unknown origin.
Ending on -g suggests Scandinavian origin, and it has been proposed: cf. Old Norse lóg, lág, which is from liggja, or its regular reflex Norwegian låg, which could have been borrowed through the Norwegian timber trade. However the Old Norse/Middle Norwegian vowel is long while Middle English vowel is short.
From logbook, itself from log (above) + book, from a wooden float (chip log, or simply log) used to measure speed.