EDB .NET Connector supports the use of logging to help resolve issues with the .NET Connector when used in your application. The connector uses classes in the EnterpriseDB.EDBClient.Logging namespace for logging.
Console Logging to Standard Error
EnterpriseDB.EDBClient.Logging.ConsoleLoggingProvider is a class that outputs error messages to STDERR. To use this class, include the following line in your application before using any of the Advanced Server .NET Connector APIs.
EnterpriseDB.EDBClient.Logging.EDBLogManager.Provider = new EnterpriseDB.EDBClient.Logging.ConsoleLoggingProvider(EDBLogLevel.Debug, true, true);
The following log levels are available:
Writing a Custom Logger
If the console logging provider does not fulfill your requirements, you can write a custom logger by implementing the EnterpriseDB.EDBClient.Logging.IEDBLoggingProvider interface, and extending the EnterpriseDB.EDBClient.Logging.EDBLogger class, for instance, writing your logs to a file. The following is a simple example of how to write a custom logger:
To use this custom logger, put the following line in your application before using any of the EDB .NET Connector APIs:
EDBLogManager.Provider = new MyLoggingProvider(filepath, EDBLogLevel.Debug, true, true);