Gloucestershire 179 for 1 (Klinger 80*) trail Glamorgan 448 (Goodwin 108, Allenby 105, Wallace 96, Hogan 51, Miles 5-83) by 269 runs
Michael Klinger played a captain's innings to steer Gloucestershire clear of trouble after Murray Goodwin's hundred and 94 and 51 from Mark Wallace and Michael Hogan respectively helped Glamorgan post an imposing 448 in their first innings.
Klinger then served up defiance aplenty, batting through two sessions for 80 not out and staging crucial partnerships with Gareth Roderick and Dan Housego as the home side reached the close on 179 for 1, still 269 runs behind but out of any immediate danger.
Yet the 33-year-old Australian was forced to ride his luck and was twice dropped in the slip cordon. He had made just 4 when he was put down by Jim Allenby off the bowling of Hogan and enjoyed another let-off on 36 when Stewart Walters fumbled what should have been a regulation catch to frustrate Mike Reed. Klinger certainly made good his escape, raising 50 from 122 balls to afford the innings a solid base.
Wicketkeeper Roderick fully justified the decision to promote him to open the batting in the absence of injured Chris Dent, contributing 41 runs and six fours in a stand of 79 with Klinger. A half-century appeared to be his for the taking, only for former Western Australia paceman Hogan to pin Roderick lbw on the front foot to initiate a breakthrough shortly before tea.
But Klinger and Housego proved immovable thereafter, the former safely negotiating 191 deliveries and the latter offering staunch support to reach the close unbeaten on 46 from 118 balls during a second-wicket stand worth exactly 100.
Goodwin earlier registered his 68th first-class hundred as Glamorgan, resuming on 318 for 5, added 130 more runs in an eventful morning session. Released by Sussex after passing 50 on only two occasions last season, the 40-year-old held sway for five hours, reaching three figures for the first time since joining his new county in the winter.
Particularly effective playing off the back foot, he cut and pulled his way to 12 fours in a patient innings of 108 that spanned 221 balls but became the first of three batsmen to fall to Craig Miles in the space of seven balls as the visitors slipped from 339 for 5 to 343 for 8. But Glamorgan captain Wallace and Hogan slammed the door shut on Gloucestershire in a whirlwind alliance of 68 in 11.1 overs, the latter raising his maiden first-class 50 from 48 balls and smiting eight fours and a six in the process.
Wallace was last man out and finished six runs short of a hundred, having staged partnerships of 68, 69 and 37 with Goodwin, Hogan and Mike Reed for the sixth, ninth and 10th wickets respectively and helped Glamorgan bank four batting bonus points.
Gloucestershire Academy product Miles returned figures of 5 for 83 and has now claimed 25 wickets in five Championship outings since breaking into the side last month. He was aided by left-arm seamer David Payne, who plugged away to finish with 3 for 87, including the wicket of Wallace, while 16-year-old offspinner Miles Hammond claimed his first victim in Championship cricket.