Logging Application Block and Unity Screencast – EntLib 4.0

Logging Application Block ScreencastI created another screencast over the weekend showing how you can integrate Unity with Enterprise Library 4.0:



This screencast discusses the Logging Application Block with Unity. The Logging Application Block comes with a LoggingBlockExtension that adds the various configuration information into Unity so you can inject a LogWriter Class into your custom business classes. This is very similar to how the Data Access Application Block works with Unity as I showed in a previous screencast:



The screencast walks through a Model-View-Presenter type scenario where you have an AddCustomerPresenter Class with a dependency on an ICustomerDataSource that has a dependency on the LogWriter Class in the Logging Application Block. The screencast shows how to create the UnityContainer, add the appropriate Enterprise Library Unity Extensions, add additional type mappings, etc. The example uses a simple Rolling Flat File TraceListener and shows you the new Midnight Rollover Setting for incremental daily log files.


If you are interested in the Validation Application Block with Unity, you can also check out that previous screencast as well:


 For more information on the Logging Application Block, I have some tutorials that I wrote for Logging Application Block in Enterprise Library 2.0 that essentially still apply:

 


I hope the Logging Application Block Screencast proves somewhat useful.


Dave


 

This entry was posted in Uncategorized. Bookmark the permalink. Follow any comments here with the RSS feed for this post.

One Response to Logging Application Block and Unity Screencast – EntLib 4.0

  1. Bryan Hinton says:

    David – I am coming to you knowing that you work a fair amount with the EntLib guys about the issue with Unity and Log App Block (http://www.codeplex.com/entlib/Thread/View.aspx?ThreadId=29005). Out of the box Unity doesn’t work with the Log App Block due to this bug – any idea how a bug so fundamental gets through like this?

    I saw the fix that was shared and have recompiled the source and can get it to work, but I don’t want to be in the business of having my own version of Entlib because it will be a major pain to get all my devs configured to use my custom binaries with the built-in config tool. Have you seen any samples on how to make it easier for the built-in VS Entlib config tool to use custom binaries?

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>