I second seebee62, as i have the same iMac. I'll add a caveat though. I would not purchase an iMac unless it was the top of the line Quad 4 model and then I would upgrade the internal disk and memory to their maximum. (Via a 3rd party, Apple is too expensive as we all know.)
The question really isn't whether the iMac can run Logic or not, it is whether it can handle the kind of workload you have. A new maxed out box will provide you the same processing a regular desktop would, though you are limited to 1 Firewire port. If you run a bunch of virtual instruments that are resource hungry (EWQL, Spectrasonics, Arturia, etc.) I would carefully consider if the iMac will be able to handle the number of tracks you typically use. Again, this will be the same as other 4 way boxes, so you will get a good bang for the buck. You will, however, find if you have a lot of sample libraries that you will have a bunch of external drives. If that is not an issue to you then no big deal. If it is, go with a Mac Pro. Also, one Firewire port is very restricting, especially if you will be streaming a good number of instruments. If you are, go Mac Pro. If you aren't, iMac is fine. You can also use the iMac and then have a second box for sample libraries using VE Pro if you want, I'm doing this right now and though it is a bit of a pain it works well.
Bottom line is, if you need expandability, iMac can't provide it very well. If you don't, iMac will do the job just fine.
-Kevin