(warning, strictly amateur advice ahead)
The SM57 will work likely work well
if your amp is turned up pretty loud and
if the sm57 likes your preamp, otherwise I think it will work merely OK. If you're in a situation where you have to record at lower volumes (e.g. in an apartment, or your preamps don't seem to like the sm57, (and perhaps if you like an extra sizzly high gain sound -- some people love that, many hate it) a small diaphragm condenser might be the better choce.
Also, moving the mic around a little bit can make a huge difference in the sound, you have to experiment a bit.
When I've mic'ed an amp in my situation, I've found the small diaphragm condensers almost always seem better to me than the SM57s. Usually, I find amp modellers (v-amp, pod, etc.) do a better job than I can do with my amps and mics anyway though, despite seeming rather gauche compared to mic'ing an amp. Could be I'm just not turning up loud enough, I don't know. I think my preamps (yamaha AW4416 preamps) are known for being pretty transparent, but lacking in gain, which maybe isn't the best match for an SM57 on
electric guitar.