asp.netazureelmah

Elmah xml over multiple instances


If I choose to have exceptions logged to an XML file in the AppData directory and then deploy the website to a cloud environment like Azure, will each instance create its own XML log file or will all the instances write to the same XML file?


Solution

  • If you set a site to auto-scale it will scale horizontally across many machines so you will not have a problem, however you'll probably hit a snag if you try to do log file amalgamation as you'll have a range of separate XML files that you can't view at once. Your best bet would be to log to a centralised location like Table Storage. See this nuget package: https://www.nuget.org/packages/WindowsAzure.ELMAH.Tables/