This article really ties two articles together. In this article I talked about discovering whether you are running normally or in the Fabric, and in this second article I talked about logging in Windows Azure
The following line of code is how you write to a log within the Fabric (in azure)
RoleManager.WriteToLog("Critical", "I am a critical error");
If however you try to run this line of code when you are not in the Fabric (e.g. normal asp.net web application), you will get an Object Reference exception.
Therefore having a common logging class which checks whether you are running in the Fabric or running normally would be a pretty useful thing.
And you can achieve that by combining this post and the other 2 posts.