简体   繁体   中英

Azure Webjob: Error logging with Elmah

Solution contains 2 projects: Main Web app project and Webjob project.

The main web app currently utilizes Elmah to log errors. I followed the following link and implemented Elmah logging in webjob app.

The problem is I have the main webapp instance and a slot which are interchanged on commit build. Due to this the applicationName to be put in app.config also changes. How do I keep the applicationName constant so that I have a single elmah.axd view to see all errors with a particular instance.

<errorLog type="Elmah.SqlErrorLog, Elmah" connectionStringName="ErrorLog" applicationName="/LM/W3SVC/5/ROOT"/>

Normally, if we use azure web app slot. We will publish project to both two slots(eg production and development).

Each two slots will have its own web application and web jobs. If you use azure web app swap to swap the production and development slots.

Both the web application and webjobs will be swapped . In my opinion, this keep the appsetting's application name always constant(development's log always log with the development application name).

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM