Middle English logge, mid-13c. in surnames and place names; late 13c. as "small building or hut," from Old French loge "arbor, covered walk; hut, cabin, grandstand at a tournament" (12c.), from Frankish *laubja "shelter" (cognate with Old High German louba "porch, gallery," German Laube "bower, arbor"), from Proto-Germanic *laubja- "shelter." On a widespread guess (backed by Watkins, OED) this likely originally meant "shelter of foliage," or "roof made from bark," and is from the same PIE root as leaf (n.).
Modern spelling is from c. 1500. The specific sense "hunter's cabin" is first recorded late 14c. Sense of "local branch of a society" is first recorded 1680s, of Freemasons, from an earlier use of lodge as "workshop of a group of masons" (mid-14c.). In the New World the word was used of certain American Indian buildings (1805), hence lodge-pole (1805) and lodge-pole pine (1859).
c. 1200, loggen, "to encamp (an army), set up camp;" c. 1300 "furnish with a temporary habitation, put in a certain place," from Old French logier "to lodge; find lodging for" (12c., Modern French loger), from loge "hut, cabin" (see lodge (n.)).
From late 14c. as "to dwell, live; to have temporary accommodations; to provide (someone) with sleeping quarters; to get lodgings." Sense of "plant, implant, get (a spear, bullet, fist, etc.) in the intended place, to make something stick" is from 1610s. Meaning "deposit" (a complaint, etc.) with an official" is from 1708. Related: Lodged; lodging.