I have .Net Worker role (Azure) and my application write to local log files in this form:
StreamWriter sw = File.AppendText("aaa.log");
sw.WriteLine("Error occured"");
sw.Close();
How can I see this log file ?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Here is the direct answer to your above question as you presented:
If you just create a blank Windows Azure Worker Role from template and add above code exactly in the OnStart() function and then test your application in Compute Emulator:
You will see the aaa.log file is created in the location below and you can match the folder details as my test application name is “TestWorkerRole”:
_your_drive_and_Folder_path\TestWorkerRole\TestWorkerRole\csx\Debug\roles\WorkerRole1\approot\aaa.log
I can also verify that it has the text “Error occurred” also in it so the code executed as it supposed to.
When you will deploy the exact same application to Windows Azure, the code will run and you will find the same aaa.log file is generated at:
E:\approot\bin
Is above approach is correct, NOT AT ALL and you must not use it, due to following main reasons:
http://msdn.microsoft.com/en-us/library/hh180875.aspx