Search code examples
c#loggingenterprise-libraryenterprise-library-5logging-application-block

EntLib5: Logging application block , configuring via code instead of a config file?


I can't seem to find any examples for configuring EntLib5 logging application block via code.

I have it configured via a config file and its working great but i would love to create another listener via code for writing out a log file for display how my plugins were loaded, succesfully or not.

Anybody have any advice or working example for doing a listener in pure code?


Solution

  • The new fluent configuration interface added in v5.0 gives you an elegant and easy to interpret way to programmatically configure EntLib. See an example here: http://msdn.microsoft.com/en-us/library/ff664363(PandP.50).aspx#fluent_api_logging

    IntelliSense will help with the rest.