The idiom sleep like a log, ‘sleep well, soundly’, does not emerge in English until the beginning of the 19th century, first in American, then British sources, at least among those readily available online:
11 [Dec. 1808, London]. Slept like a log till ten, and then was called. This atmosphere is certainly narcotic. You see all along how enormously I have slept.— Aaron Burr, The Private Journal of Aaron Burr, During His Residence of Four Years in Europe, Matthew Livingston Davis, ed., 1838.
Then he went home and slept like a log. — Very Funny, Not Too Funny; Just Funny Enough (collection of newspaper anecdotes), cited from Boston Transcript n.d., New York, 1830.
If it was five P. M., he always preferred taking a drop at that particular hour. If it was ten in the evening, that was a time particularly favorable for taking something; and a cup of hot sling made a glorious night-cap, wherein a man might sleep like a log. — Asa Greene, The life and adventures of Dr. Dodimus Duckworth, New York, 1833.
... had slept like a log of wood all night, and that he had not had a wink of sleep; — Gloucestershire Chronicle, 12 April 1834. BNA (paywall)
‘Why, I always sleep like a log,’ said the lodger; ’and I believe it would puzzle the thunder itself to wake me up when I get fairly into one of my naps.’ — “Miscellaneous from the New York Transcript,” Indiana American (Brookville), 4 Sept. 1835.
November 21st [1837], at 9 A. M. Visited my patient this morning, and found him improved in every respect. Says he “slept like a log all night.” — New York Journal of Medicine, May 1845.
Because the actual text is behind a paywall, I was unable to verify whether the source of the Gloucestershire article is English or American. The story appearing in the Indiana paper, for instance, was also published in several papers in the UK.
That while unconscious the human body might resemble a log did not escape earlier speakers, but there is no sense of restful or even healthy sleep — here, either a drunken stupor or a nervous disorder:
give but your little wench freely her liquor,
and to bed send her, you will find her quicker;
pearter, nimbler, both to kiss, and cog,
then your great wench that will lye like a log — Francis Kirkman, The Wits, 1662. EEBO
Galen … mentioneth a Story of a School-fellow of his, who when he had wearied himself with long study, fell into a Catalepsis, or Congelation ; He lay (saith he) like a Log all along, not to be bent, stiff and stretched out, and seemed to behold us with his eyes, but spake not a word ; … Lazare Rivière, The Practice of Physick, 1668.
In Middle and Early Modern English, other metaphors complete the phrase slept like a .... One that shows up in Chaucer is apparently still current:
This messager drank sadly ale and wyn,
And stolen were his lettres pryvely
Out of his box, whil he sleep as a swyn — Geoffrey Chaucer, Man of Law’s Tale, Canterbury Tales
“Did you have a bad dream last night, Joe?”
“Nope. Slept like a swine on fresh straw.” — Jonathan Pearce, Community Spirits: Infestations on the Spectral Plane, 2005.
And particularly sleep like a top:
shall sleepe like a top else — John Fletcher, William Shakespeare, The Two Noble Kinsmen, perf. 1613–4, pub. 1634. EEBO
but venus gave t' other a sop,
that made him sleep like any top; — Charles Cotton, Scarronides: or Virgile Travestie, 1664. EEBO
… and he will sleep like a top. — William Congreve, The Old Bachelor, 1693.
… and then I went to bed and slept like a top till breakfast time. — Vincennes Gazette (IN) 15 Feb. 1834.
The metaphoric potential of logs was exploited in other ways:
foundering is when she will neither veere nor steare, the sea will so ouer rake her, except you free out the water, she will lie like a log, and so consequently sinke. — John Smith, A Sea Grammar, 1627. EEBO
the poor soul is pulling and tugging with its own heart, and finds his heart heavie and dull, like a log in a ditch; and have not many of you found your hearts so? — Jeremiah Burroughs, Gospel-worship, 1653. EEBO
One could also stand like a log or fall like one:
sir kenelm digby relates, that in the year 1663: the lady warwick told him, that a daughter of her husbands elder brother had the falling-sickness in the greatest extremity, so that she fell like a log seven or eight times a day without any motion: — Kenelm Digby, George Hartman, ed. and publ., A Choice Collection of Rare Secrets, 1682. EEBO