Microsoft's Patterns And Practices recently released CTP of Semantic Logging Application Block (SLAB) as part of Enterprise Library suite. It can be downloaded from their codeplex site.
UPDATE: Official first release of SLAB has been included in Enterprise Library 6. There is a new post on the same here.
It provides a solution for a very common problem - Logging. It enables developers to have a structured way of logging events (business, technical, error etc.) so that the later analysis of the logged information can produce valuable inputs to the business. It is not that SLAB brings a new way of looking at things. Instead, it brings out a prescriptive solution which uses ETW (Event Tracing For Windows) to ensure high performance logging and provides two different flavors of logging - synchronous and asynchronous. The underlying intent and approach remains the same though.
I want to highlight two general points about logging which apply to enterprise applications irrespective of the solution you chose for logging (SLAB or no SLAB - it should not matter).
- Semantic logging is a generic concept that can be implemented even with good old Enterprise Logging Application Block.
- You need to decide upfront, perhaps during planning phase, about the data points you will like to collect. For example - If your application is a flight booking website, you may be interested in storing information about the flight searches being done on the website (to find a trend and may be show a cheap fare as a link of home page in a week's time to attract new visitors), the steps where users withdraw from your website when they are guided by the booking flow of website (to find a pattern), the time taken by payment gateway and insurance providers, number of times you contacted a third party (to keep an account of usage for later reconciliation) etc. Once these events and the data related to each event is decided, rest of the steps are fairly easy.
I created a simple demo application that implements the idea of semantic logging. It's current implementation directly logs information in the EventLog but can be modified easily to use Enterprise Library or SLAB to log information - the key is that infrastructure and separation required for logging key business information is moved into one project - SemanticLogging.Demo.Analytics. You can choose to use a different storage that support querying (e.g. Database) to enable development of a dashboard like functionality that can be used by business analysts to measure effectiveness of new changes.
If you use Logging Application Block of EntLib, then you can assign categories to each business area so that logging can easily be enabled or disabled for a particular business area. E.g. you can log analytics data related to airfare search under "AirFareSearch" category and analytics data related to booking of air tickets under "AirTicketBooking".
Of course, this is just a demo of concept and the actual solution can be bettered with time and effort.
Of course, this is just a demo of concept and the actual solution can be bettered with time and effort.
You can download the solution here.
No comments:
Post a Comment