Legg has put-pen-to-paper on a new two-year contract at London Road.
"I am delighted Andy has signed a new two-year contract, a deal he was always going to agree to. Andy is a very important part of this football club," manager Barry Fry told the clubs official website.
"As well as having an outstanding second half of the season on the pitch he is also a part of my management team. I am delighted Andy has committed his future to us."