Gloag was born in
Perth on 7 February 1828 to Jessie (née Burn), daughter of John Burn,
Writer to the Signet, and William Gloag, a banker in Perth.
Paton James Gloag the theologian writer and
Moderator of the General Assembly of the Church of Scotland in 1889, was his eldest brother, and his eldest sister was Jessie Burn Gloag, who founded a
ragged school in Perth. Gloag was educated at
Perth grammar school and the
University of Edinburgh. He passed the Scottish bar on 25 December 1853, where he enjoyed a fair practice. A Conservative in politics, he was not offered promotion until 1874, when he was appointed
advocate depute on the formation of
Disraeli's second ministry. He died at Kincairney on 8 October 1909, and was buried at
Caputh. ==Family==