So long, an expression of farewell, is a colloquialism that we take for granted as being a logical construction. It'll only be so long before you meet again, right? However, no senses of these two words actually add up to mean "good-bye." So where did it come from?
Some believe the phrase to be adapted from another language. One suggestion is that so long is from the Irish good-bye slán, which is not an unreasonable theory, but does have a few gaps. First is that without cues, speech in an unfamiliar language is mainly heard as a succession of meaningless syllables, so native English speakers would likely not have acquired the word just from hearing it.
Second, we would expect to see early evidence of so long in the English of Ireland or in Irish-American speech—if slán was perhaps being reshaped by bilingual speakers—but such evidence is lacking.
Other possible sources that have been proposed include German adieu so lange (roughly translated: "farewell until we meet again"), Hebrew shalom (a greeting and a good-bye), and Arabic salaam (which is a greeting, not a good-bye, and is thus disqualified). Except for having similar sounds, these terms, like Irish slán, have no provable connection to the English expression.
Usage history of so long suggests it could be an Americanism. Early use is found in Walt Whitman's poem about death and leave-taking entitled "So long!", which was published in the 1860 edition of his Leaves of Grass.
While my pleasure is yet at the full, I whisper, So long! / And take the young woman’s hand, and the young man’s hand, for the last time.
So long! Remember my words—I may again return, / I love you—I depart from materials; / I am as one disembodied, triumphant, dead.
It appears that the expression was not yet generally understood by Whitman's American contemporaries. A friend of his hadn't heard it until he read the poem, and when he asked Whitman to define it, he called it "[a] salutation of departure, greatly used among sailors, sports, & prostitutes—the sense of it is till we meet again—conveying an inference somewhere, some how [sic] they will doubtless so meet—sooner or later."
It is unknown where Whitman picked up this new expression of farewell, but (of course) evidence of it shows up only five years later in Australian writings, throwing the whole thing into question yet again.
Wherever the expression originated, it diffused quite rapidly. By the 20th century, so long became a common expression of farewell—and no one knows how it happened.