It is narrated from Sayyiduna Abu Ayyub (may Allah be pleased with him) that the Messenger of Allah (peace and blessings be upon him) said: "Whoever of you goes to relieve himself, let him not face the qiblah nor turn his back towards it. Face east or west."
Hadith Referenceالمعجم الكبير للطبراني / باب الخاء / 3923