Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

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.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7935289
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T21:52:30+00:00 2026-06-03T21:52:30+00:00

I have .Net Worker role (Azure) and my application write to local log files

  • 0

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 ?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-03T21:52:31+00:00Added an answer on June 3, 2026 at 9:52 pm

    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:

      public override bool OnStart()
      {
          // Set the maximum number of concurrent connections 
          ServicePointManager.DefaultConnectionLimit = 12;
          StreamWriter sw = File.AppendText("aaa.log");
          sw.WriteLine("Error occured");
          sw.Close();
      
          return base.OnStart();
      }
      
    • 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:

    • Windows Azure VM are not persisted so anything you create may not available later so you must have a way to move your data
    • Windows Azure provide a specific way to add diagnostics in your application in which the all the logs are created a specific fixed location in your Windows Azure VM and then based in your setting (Azure storage and time to transfer logs) these logs are transferred from Azure VM to your Windows Azure Storage.
    • You must use Windows Azure Diagnostics method to add any custom log method which is described in link below:

    http://msdn.microsoft.com/en-us/library/hh180875.aspx

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a class library shared between an Azure Worker Role and a ASP.NET
My situation is this: I have an ASP.NET web application that I want to
I'm trying to set up Quartz.NET in an Azure worker role for scheduling a
I'm making my first application in Windows Azure and I have some problem. This
We have an ASP.net (2.0) application configured to run with multiple worker processes using
I have 2 Windows Azure Worker Roles, and 1 Cloud Drive VHD (for Lucene.NET
I'm currenlty using Azure Blob to store files, and upload/download from ASP.Net Application hosted
My Asp.net application is hosted over Azure Cloud, In that application I do have
This is a problem is related to worker role hosted VM. I have a
I have a co-worker who supervises a group of ASP.NET developers who are doing

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.