As far as I know it's from a Scottish place name which derives from the Gaelic lag meaning "hollow." It's related to Logan which has the same meaning.