Fruit flies get their name as they are attracted to ripened or fermenting fruits and vegetables. However, they are often found to breed in drains amongst moist organic matter which makes them a potential nuisance all year round.
As with most pest control, prevention is certainly better than cure for fruit flies, so a high standard of sanitation is of paramount importance. If, however, pest problems are detected the site should be inspected thoroughly as they may have several breeding places, wherever fermenting, moist and decaying organic materials are available.
There are fruit fly pest control traps available that use vinegar or other fermenting foods to lure and capture fruit flies, such as jar traps. Pesticide are also an option, but may only provide temporary relief, so be sure to contact a pest control professional to discuss the best long-term options.