One problem related to check engine light on has been reported for the 1997 Subaru Legacy. The most recently reported issues are listed below.
While traveling at 70 mph engine light illuminated and smoke came from under hood. Driver pulled over, popped hood, and noticed coolant and oil sprayed over engine. Also a couple of flames were present. Dealer said it was a blown head gasket.