I don't necessarily like removing the chain from the bar but it forces me to do a through cleaning of the grooves, oilways etc. and a through inspection of the whole assy. including the chain brake and housing/fins. I use compressed air and goggles and blow out every nook and cranny. Tons of stuff accumulates in these areas in no time.
At the same time I flip the bar over to increase its life and swap out to a sharp chain. This is what the saw mfg's. recommend and it works well for me.
I mostly hand file or drop off spare dull chains - my time is more valuable doing other things than sharpening chain on a regular basis.
As to dirt and sparks etc. Loggers toss the first ten feet of trees often to eliminate the possibility of nails, barbed wire etc. having grown into the tree. To eliminate or at least reduce the effects of dirt and rocks when cutting logs consider a peavy, or lifting the log at one end and cutting to lengths half way through from the top and then rolling the log to cut the rest of the cut. Or land each log across two other logs that are already on the ground at your log landing, to raise your log to be cut off the ground.
If you have a tractor winch one can lift the log to the backplate to keep it off the ground and then discard the other end that drags in the dirt.
I like Stihl and Oregon chains and use my beat up older bars and chain for cutting where I know I'm likely to hit dirt or rocks; like around stumps and roots, etc.
On my flip house property I just sharpened a chain and immediately saw sparks as the chain found its way to hidden barbed wire in the area around the tree stump!
My friend who is a pro, like I used to be long ago, says whenever you need to find metal sharpen your chain!:confused2: