Help using environment overrides (for logging)

Topics: Enterprise Library Core, General discussion, Logging Application Block
Dec 19, 2008 at 2:44 PM
Can anyone point me to a step-by step guide for using environment override configuration files, or explain a few things for me?

Maybe it's just me but I find it hard to see from the documentation what I should enter as the EnvironmentConfigurationFile and EnvironmentDeltaFile for an Environment, and then what build/post-build commands I'd use to create the resulting config file. Should I still end up having a single MyProgram.exe.config that I deploy? If so, does my app.config file get copied to MyProgram.exe.config (automatically by the normal compile process), and then I should set up a post-build command to replace it with app.config merged with environment.dconfig?

Specifically I want one configuration for development, with lots of logging, and another for live, with not much logging. I understand how to create an Environment in the config file editor and set overrides for different properties generally, but how do I set up the environment (ie its EnvironmentConfigurationFile and EnvironmentDeltaFile) and my build process?

In order to override a category so that it's logged in one environment and not in another, I'm guessing that I set the 'SourceLevels' of one environment to 'Off' and then the other environment (or the base file) to the desired level e.g. 'All'. Is that the recommended method?

thanks for any tips or suggested reading,

Dec 22, 2008 at 9:36 AM
Check out these links.

Sarah Urmeneta
Global Technology & Solutions
Avanade, Inc.