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

2.4k Views Asked by At

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?

2

There are 2 best solutions below

2
On BEST ANSWER

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.

0
On

I have not yet looked at the Entlib 5 yet but in principle the Api should be the same as for Entlib 2.0. Here is an example how to configure it via code.