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).