I took a closer look at the PHP code and I think exporting the log should work for non-English languages like Turkish as long as the encoding is set correctly (UTF8) in mysql and in your connection to the database. There are a lot of areas where this stuff can be wrong, so debugging is pretty difficult.
My guess is that the file is exporting properly, but the program you are using to view the file does not know that its contents is UTF8 (UTF8 is the encoding needed for most non-English languages).
We can check that by you trying the following. First, rename the exported log file so that it ends with .txt instead of .csv. Next, use Google Chrome and do a File / Open File and select that .txt file off your hard drive (to be clear, you are loading the file into Google Chrome, you are not going to a webpage). Ok, now you should see the log file contents in Chrome and it may still look like it did before, or it may look right. Assuming it still looks messed up with the weird characters and stuff, then choose View then Encoding from the Chrome menu and I’m guessing it will have a checkmark next to “Western”. Try selecting “Unicode (UTF-8)” and see if the text in your Chrome window suddenly looks right. If so, then everything is correct and the problem is simply that you were looking at the file using a program that didn’t realize the file was UTF-8 encoded.
So, do the above and report back. Also, answer the following questions:
1. What operating system are you using?
2. What program were you using to view the .csv file (maybe Excel or a text editor or Word or something like that)?