What are the better ways to achieve low overhead distributed logging on Azure?
Share
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.
We use log4net as the logging library for our multi-tennant Azure Web Role. The log4net ADO.Net appender is used to log all errors to a SQL Azure database. To filter logs by client/user, we use a few log4net.GlobalContext properties, like so:
Each “Provider” is just a simple class that overrides the ToString() method. When ToString() is called by log4net, we grab a value from the current session (this technique is discussed in this SO answer).
I hope this addresses your question. If so, you might want to check out this good write-up on log4net logging contexts.