Any combination is possible. One key is to lift up the handlebars either before or during contact with the log. Frequently, your chainring will contact the log as you pedal over. A good one will not bend or be damaged. A rock ring may be used, but I prefer just using the large chainring.
Teeth can be damaged on rocks or logs, so maximum ground clearance is important.
Good mountainbikers know when they will hit the log with the chainring, and when they will clear it. Use the lift and lunge technique. Water bars are intentionally placed on some trails for erosion control, and it is best not to go around them as you create a funnel for the water to follow. Hit logs as close to 90 degrees as possible, and if they are wet or slippery, be especially careful. Be prepared to put your foot down if necessary if you are not clipped in.