(covers information from several alternate timelines)
Flogging was the practice of beating someone with a whip as punishment.
In 2152, Malcolm Reed sincerely apologized for his "inexcusable" act of leaving his communicator behind on a pre-warp planet and invited whatever punishment Captain Jonathan Archer deemed sufficient. Archer sarcastically suggested thirty years in the brig or a good flogging before assuring Reed that his actions "could have happened to any of us. (ENT: "The Communicator")
In 2374, after a stressed Kathryn Janeway berated Tuvok for letting the crew of USS Voyager become lax on ship's protocol, she suggested that he straighten out the department heads. He asked her if she would like him to flog them as well. (VOY: "Scientific Method")