Loading user information from Channel 9

Something went wrong getting user information from Channel 9

Latest Achievement:

Loading user information from MSDN

Something went wrong getting user information from MSDN

Visual Studio Achievements

Latest Achievement:

Loading Visual Studio Achievements

Something went wrong getting the Visual Studio Achievements

Introducing Semantic Logging

42 minutes, 43 seconds


Right click “Save as…”

Meet the new application block from Microsoft patterns & practices team - the Semantic Logging Application Block. It 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 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 then you can decide later whether you want those events to go to ETW or alternative destinations.

In this tutorial, we demonstrate the Semantic Logging Application Block in action. We also showcase the out-of-proc service to help reduce the logging overhead in your applications and improve fault tolerance of the logging process.

[00:03] - Semantic Logging - Impetus.
[09:04] - Structured logging technologies (ETW, EventSource, SLAB).
[12:31] - Walkthrough: Authoring an EventSource
[21:15] - Walkthrough: Using SLAB in-process
[31:42] - Walkthrough: Using SLAB out-of-process
[38:39] - Walkthrough: Using PerfView

[41:50] - Conclusions

For more information, please read the conceptual overview of semantic logging and visit the Codeplex site.


Follow the discussion

  • Oops, something didn't work.

    Getting subscription
    Subscribe to this conversation
  • codematrixcodematrix

    This probably why I've been using ReflectInsight for last few months

  • deepakdeepak

    Sample application is using Azure table "SLAB" but the structure of that table is not given in source page in codeplex.
    I am trying to integrate SLAB in local SQL Server but i think due to missing SLAB table structure it's not working.
    Can you provide some example for SQL Server logging?

  • Hi Deepak. The script for creating the SQL table is included in the SemanticLogging.Database nuget package (but not added to the project, so you won't see it there). Go to the "packages" folder in your solution, search for that nuget package, and it should have the SQL scripts inside the "scripts" folder.
    To use it from code, just do SqlDatabaseLog.CreateListener(...) passing a connection string and the rest should be the same as in the other examples (enable which events to listen and so on)

  • PaulPaul


    I am trying to implement the azure listener but I could not use this Class:

    var listener = new Microsoft.Practices.EnterpriseLibrary.SemanticLogging.EventListener.AzureTableEventListener();

    it is not recognizing EventListener am I missing something?

  • SalSal

    Can you please point me sample app ?

  • deepakdeepak

    Thanks Juliandom, I am not to log the data in SQL database now.
    Is Semantic Logging works asynchronously?

  • Also see updated demos from //Build. They show how complex logging scenarios can be implemented just with a few lines of code using the power of SLAB and Rx.

  • @Paul:I have the same problem... Am I missing a DLL (I installed from nuget)

  • The Windows Azure Table sink is in a separate NuGet package, EnterpriseLibrary.SemanticLogging.WindowsAzure. Same for the SQL Server sink, EnterpriseLibrary.SemanticLogging.Database.

Remove this comment

Remove this thread


Comments closed

Comments have been closed since this content was published more than 30 days ago, but if you'd like to continue the conversation, please create a new thread in our Forums, or Contact Us and let us know.