DISCLAIMER: Microsoft has not published the documentation on how plug-ins in Azure SDK work (such as Diagnostics, Remote desktop etc.) This sample is provided as is, and based on my observations.
Microsoft’s Patterns and Practices team had released the Semantic Application Block with Enterprise Library 6 release (can be downloaded from here http://www.microsoft.com/en-us/download/details.aspx?id=38789).
It is an awesome logging implementation that makes use of Windows ETW (Event Tracing for Windows http://msdn.microsoft.com/en-us/library/ms751538(v=vs.110).aspx). You can see the documentation at http://msdn.microsoft.com/en-us/library/dn440729(v=pandp.60).aspx.
The block helps you to generate logs, but also provides various sinks to record the logs to different stores. One possible (and recommended) host for the sinks that write the ETW logs to a store is an out of process service, which can be configured with a declarative file to redirect the logs to various sinks.
The shipped service can be downloaded from this location: http://go.microsoft.com/fwlink/p/?LinkID=290903
In order to deploy the service to an Azure role, you can write your own bootstrapping code, but we wanted to make it easier for you to do it through Azure SDK’s plugin mechanism.
Basically, the steps are:
- Download the sources from https://github.com/fullscale180/azureslab
- Copy the downloaded “SLABSink” fodler under “C:\Program Files\Microsoft SDKs\Windows Azure\.NET SDK\v2.2\bin\plugins” folder under
- Add a file named “SemanticLogging-svc.xml” as a project item under the role in the azure project (so it ends up in the approot directory of the deployment). There is also a sample in the git repository at the root folder. Do not copy the xml file with the plugin files to your SDK folder. Make sure the file name is exactly that.
- Edit the file to your liking
- Add the plugin to the imports section of the role in the csdef file. ( <Imports> <Import moduleName=”SLABSink” /> </Imports> )
- And deploy the project, volia!
What the plugin does is to run a startup script during the deployment. It’s steps are:
- Download the service from the location above
- Unzip to a folder called SLAB under the approot
- Copy your SemanticLogging-svc.xml to the SLAB directory, and replace it with the sample one. If you have not provided one, it uses the default one that ships.
- Start the service