Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: C# library VB.NET Enterprise , +
Hi All,
 
My question is simple but scenario is bit complex.
 
I want to configure Enterprise Lib Logging at runtime, how do I do that.
 
I have a library which is, logging data using EntLib 3.1 Logger Application Block. Now this library is being consumed in various services, so ideally logging should consume configuration setting from web.config of each services.
 
Now I don't want that, as my logging is going to be same in all services so I want to load logger from single configuration (Either from config of DLL or can load config for logger at runtime). I tried my all possible way, please help me if someone has any direction in this subject.
 
I went through following stuff, but those are not useful for me.
 
http://stackoverflow.com/questions/624436/can-i-change-the-configuration-of-the-enterprise-library-logging-block-at-runtim[^]
 
http://stackoverflow.com/questions/1771808/entlib-logging-add-edit-tracelisteners-at-runtime[^]
 
Thanks
Rushi
Posted 4-May-12 6:41am
Edited 4-May-12 6:44am
v2

1 solution

Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

  Permalink  
Comments
rushijoshi at 4-May-12 16:46pm
   
Mark, thank you for sharing your post. That is really a good thread but was not helpful to me. But thank you for sharing this.
Mark Nischalke at 4-May-12 21:56pm
   
You're welcome. I don't understand your question then. This at least showed how to load configuration files from different sources and at runtime, which is what you have described.
rushijoshi at 4-May-12 22:40pm
   
Yes that is right, but my intention is to load for Logger and there is no any way to assign LogWriter to Logger object.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



Advertise | Privacy | Mobile
Web01 | 2.8.1411022.1 | Last Updated 4 May 2012
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100