MICROSOFT ENTERPRISE LIBRARY

SEMANTIC LOGGING APPLICATION BLOCK

COMMUNITY TECHNOLOGY PREVIEW (CTP) RELEASE

Release Notes

13 Feb 2013

Disclaimer

This release is not intended for use in a production environment.
This release is provided as a preview only. The purpose is to inform the community and to solicit early feedback.

Where to get it?

The binaries are available via NuGet - search online for the slab package. In the NuGet package manager UI make sure to switch the dropdown at the top from "Stable only" to "Include Prerelease".

Additionally, the following assets are available via Codeplex downloads:
  • Windows service (SemanticLogging-svc.zip) for collecting log messages out-of-process
  • aExpense reference implementation (SemanticLogging-aExpenseRI.zip)
  • Source code
  • Reference documentation (early draft)
  • Chapter on Semantic Logging from the upcoming Developer's Guide (early draft)

What is it?

The new Semantic Logging Application Block (SLAB) is intended to help you move from the traditional, unstructured logging approach (such as that offered by the Logging Application Block or log4net) towards the semantic logging approach that improves the consistency of the logs and simplifies significantly their consumption and automatic processing.

The Semantic Logging Application Block enables you to use the EventSource class (new in .NET Framework 4.5) and semantic log messages in your applications without moving away from the log formats you are familiar with (flat files, databases, Windows Azure table storage etc). Importantly, you do not need to commit to how you consume events when developing business logic; you have a unified application-specific API for logging and you can decide later whether you want those events to go to ETW or alternative destinations.

The block also comes with the out-of-proc service to help reduce the logging overhead in your applications and improve fault tolerance of the logging process.

For a conceptual overview of semantic logging, see http://aka.ms/semantic-logging

Note: SLAB should not be confused with the existing Logging Application Block.

How to get started?

  1. Read the conceptual overview
  2. Watch the video walkthrough of using SLAB in a sample application
  3. Download and play with the sample app
  4. Download the SLAB NuGet package and evaluate it with your app(s)
  5. Review the documentation drafts and remember to provide feedback
  6. If you have any questions, ask them in the discussion forum dedicated to SLAB

How to use SLAB?

Please refer to the instructions for the application block in the Reference Documentation and the Developer’s Guide.

To use in-proc SLAB follow these steps:
  1. Add the "Enterprise Library - Semantic Logging Application Block" NuGet package (EnterpriseLibrary.SemanticLogging) to the Visual Studio project in which you want to use semantic logging. In the NuGet package manager UI make sure to switch the dropdown at the top from "Stable only" to "Include Prerelease".
  2. Create an event source class that defines your log messages by extending the EventSource class in the System.Diagnostics.Tracing namespace.
  3. Add code to your application that generates log messages by invoking methods in your EventSource implementation.
  4. Instantiate and configure in code one of the event listener classes included in the block.
  5. (Optionally) If you are using one of the database event listeners, run the supplied script to create a suitable database to store log messages. The script is included in the NuGet package itself and can be found at: <SolutionDir>\packages\EnterpriseLibrary.SemanticLogging.<version>\scripts\DatabaseEventListener.sql

To use the out-of-proc SLAB service, follow these steps:
  1. Create an event source class that defines your log messages by extending the EventSource class in the System.Diagnostics.Tracing namespace.
  2. Add code to your application that generates log messages by invoking methods in your EventSource implementation.
  3. If you want to collect and process log messages out-of-process, download and install the SemanticLogging-svc.exe Windows Service and edit the supplied configuration file (SemanticLogging-svc.xml) to define the event listeners. The block includes an XML schema file (SemanticLogging-svc.xsd) to support editing this configuration file in Visual Studio.
    • The download includes a PowerShell script, install-packages.ps1, that uses NuGet to download and install the dependencies of SemanticLogging-svc.exe in the current folder.
    • To install and run SemanticLogging-svc.exe as a Windows service, run SemanticLogging-svc.exe -start.
    • To install and run SemanticLogging-svc.exe as a console application, run SemanticLogging-svc.exe -console.
  4. (Optionally) If you are using one of the database event listeners, run the supplied script to create a suitable database to store log messages.

Systems requirements

  • Visual Studio 2012
  • .NET Framework 4.5
  • For the optional database event listener or to run the sample app, you will need a database (SQL Server or LocalDB)

Known issues and notes

  • The current implementation of the out-of-process listeners for ETW is not optimized for production performance.
  • For simplicity sake, we packaged everything in a single NuGet package. In the future, we may split the package into more granular packages corresponding to individual technologies (such as Windows Azure storage or Database) for each listener.

How to provide feedback?

To provide feedback about this release, the reference implementation or written guidance, or to get help with any problems, please visit the Semantic Logging Application Block discussion forum.

We look forward to your comments!

Last edited Feb 13, 2013 at 11:04 PM by gmelnik, version 16

Comments

No comments yet.