David Hayden [MVP C#]

Sponsors

The Lounge

News

  • CodeBetter.Com Home

Other Links

Teas

Patterns & Practices

Florida .NET Developer

Book Reviews

Tampa ASP.NET MVC Developer Group

Advertisement

Images in this post missing? We recently lost them in a site migration. We're working to restore these as you read this. Should you need an image in an emergency, please contact us at imagehelp@codebetter.com
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

 


Posted Sun, Jun 1 2008 11:48 PM by David Hayden

[Advertisement]

Comments

Bryan Hinton wrote re: Logging Application Block and Unity Screencast - EntLib 4.0
on Wed, Jun 11 2008 5:03 PM

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 (www.codeplex.com/.../View.aspx).  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?