Skip to main content

This is documentation for Caché & Ensemble.

For information on converting to InterSystems IRISOpens in a new window, see the InterSystems IRIS Migration Guide and Migrating to InterSystems IRIS, both available on the WRC Distributions pageOpens in a new window (login required).

Enabling Logging Dynamically

You can use your configuration file to enable and disable logging dynamically. Using the example configuration file from the earlier page, your code needs only to test the value of logging in the configuration file. For example, in your code that initializes the connection you would enable logging with the following code:


private void InitConnection()
{
    ...
    
    if (ConfigurationManager.AppSettings.Get("logging").Equals("yes"))
            {
               cacheConnectStr += 
               ";LogFile = " + ConfigurationManager.AppSettings.Get("logfile");
            }
            
    ...
}
Copy code to clipboard
FeedbackOpens in a new window