What kind of mushrooms are you growing? In my experience, shiitake are generally maggot free, while oysters attract fungus gnats like crazy. I grew mushrooms outdoors on my patio in Portland, Oregon for nine months out of the year (not on logs but on sawdust blocks and on
cardboard boxes and paper) and I had some problems with other creatures wanting to eat my mushrooms.
slug damage by
frankenstoen, on Flickr
At first, my outdoor mushrooms were free of pests. But then, the word got out. Hundreds of slugs showed up, and thousands of fruit flies. My oysters (especially my king oysters) were riddled with holes and full of squirming maggots. I hung up fly paper around my sawdust blocks, and that helped, but only a little. (The fly paper works really well indoors, though.)
And then, after about a month of maggot-filled mushrooms, a funny thing happened. The spiders showed up. Thousands of spiders. And my gnat/maggot problem pretty much went away, not completely, but to the point where it wasn't a problem anymore. Nature saw that there was a problem (surplus gnats) and sent predators there to restore balance. I didn't have to do anything.
Tiny Spiders! by
frankenstoen, on Flickr
The slugs, well, I had to go out every night around midnight and pick them off by hand. Perhaps given
enough time, Mother Nature would have come up with a solution there, too. (Maybe something that likes to eat slugs, like ducks?)
baby slug by
frankenstoen, on Flickr