(n.) 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).
From Middle English logge, from Old French loge (“arbor, covered walk-way”), Medieval Latin lobia, laubia, from Frankish *laubija (“shelter”), from Proto-Germanic *laubijō (“arbour, protective roof, shelter made of foliage”), from Proto-Germanic *laubą (“leaf”), from Proto-Indo-European *lōubh- (“the outer parts of a tree, bark, foliage”). Cognate with Old High German louba (“porch, gallery”) (German Laube (“bower, arbor”)), Old High German loub (“leaf, foliage”), Old English lēaf (“leaf, foliage”). Related to lobby, loggia, leaf.
I wonder whether this sound change -b- > -g- happens regularly or not?