My three year old Patterdale terrier is fully house trained and has been since she was a pup. We have not moved houses, changed her diet, or had any stress at home that she could pick up on; however, she has begun to poop on the downstairs rug at night while we are asleep. She appears to be normal in all other aspects and knows that she's wrong in hiding, etc. We take her out on at least 3 long walks a day and she goes out to the lawn in between. Why is she doing this?
Try feeding your dog earlier - around 3-4.30pm in the afternoon. It may then empty it's bowels earlier - outside - before you go to bed.
Have her anal glands checked. I know it sounds weird but their glands around the anal get clogged with waste and it gives them the feeling of having to "go". Does she scoot on the floor? That is a sure sign. Also if she has any lower back problems it may cause a pressure on her bowels.