i just wanted to say thank you and if any othere person has same problem, following is solution for it:
// before
$header = '"Date Time", "Error", "Message", "SQL", "Line", "File", "IP", "Envoirment"'."\n";
//after
$header = '"Date Time","Error","Message","SQL","Line","File","IP","Envoirment"'."\n";
dont put space after comma, if you put space then it will not take " double quotes as enclosed key.
glad to help and get help, thank you every one.