LAB with SharePoint WebParts

Topics: Building and extending application blocks, General discussion, Logging Application Block
Aug 13, 2010 at 1:54 PM

I am not sure if I am trying to use the LAB incorrectly or it was just designed to work differently than I want it to.   Here is what i would like to do:

I want to setup LAB in SharePoint on a global level and allow people who write custom web parts in our company to be able to log using the LAB.  To do this i would normally set it up as some of the other links on the discussion have shown with SharePoint.  However, I want the custom webpart developers to be able to change their logging capabilities *without* having to have them change the web.config file.  We do not allow changes to the web.config in our deployments, so we would need some other way of changing it.  Is there a way you can specify a configuration to use within the LAB?  From what I can see, it's a static object that gets everything it needs from the app level config file with no way to create an instance-based version.  Please let me know if there is a way I can do this.  It would make it nice to have a centralized logging solution (for exception handling an other things) within SharePoint as well as the ability for the other developers to be able to use those same libraries to log to their data store.


Let me know if this makes sense and if this can be done.



Aug 15, 2010 at 1:41 PM


Personally, I haven’t used Sharepoint yet and I’m not sure if you have already seen this blog. If not then I hope it would somehow help to get you started using entlib in sharepoint.

The way I understand what you want to achieve is to have a separate LAB config files other than your application config file. Please let me know if my understanding is correct. If yes, check this blog and see if approaches like using FileConfigurationSource or ConfigSource will fit for your needs. Though, this will not completely prevent you the needs of modifying your app’s config file but will minimize it at some point. Another approach you can use is the EntLib 5's Fluent Configuration API, you can check the documentation, on this approach you can eliminate the use of a config file. Let us know if this fit your needs. HTH

Gino Terrado
Global Technology and Solutions
Avanade, Inc.

Aug 16, 2010 at 2:46 PM

That's exactly what i needed to know.  Thank you very much.  The Fluent Configuration API was what I was missing.  This will now allow our web part developers to create their own logging/exception handling configuration without having to modify any of the web.config files or having any files for overhead.