Subtract 4 inches from your front width.
Measure across the back wall of the fireplace.
Subtract 8 inches from your front width to allow for the pilot kit.
Your log set size is limited by the space required for the burner and its control system. Use these general "subtraction" rules for the front opening width:
How To Measure for and Choose a Gas Log Set - Fireplace Doors Online
Measure from the front opening (behind any lip or ledge) to the back wall.
Before shopping, use a tape measure to record these four dimensions in your firebox: