Configuring Logging Providers for AIF

You can configure additional logging providers for AIF in order to log specific events and results. You will add your customized logging provider as an additional provider, and will not change the configuration of existing logging providers. Logging provider is created by implementing the ILogging interface in a custom class. ILogging interface is available in the Microsoft.Ccf.Common.Logging assembly references from the folder <InstallDir>/Framework.

The ILogging interface holds the methods and properties required to implement custom configuration. The ILogging class is explained in the following tables. The following table describes the properties of the ILogging interface.

TILogging Interface Properties

Name

Type

Description

Tag

string

The parameter to hold user-defined data associated with the object.

ShowErrors

Bool

The parameter that defines if the errors are shown. Ensure that the ShowErrors property is set to true to log errors.

ILogging Methods

Signature

Description

void Error(string applicationName, string message, string advanced)


Logs an error message in the file defined. The applicationName defines the application and the message holds the text to be logged.

void Information(string applicationName, string message)


Logs an informational message in the file defined. The applicationName defines the application and the message holds the text to be logged.


void Initialize(string name, NameValueCollection configValue)

Allows the application to initialize the logging listener. In this method, ensure you set the ShowErrors property to true. Use the FileLocation configuration value to set the path of the log file. You can add the required configuration parameters to your provider by specifying them as name value pairs when you configure the provider. CCF will send the specified named parameters to the provider in a NameValueCollection object during intialization.

void Trace(string applicationName, string message)

Logs a trace message in the file defined. The applicationName defines the application and the message holds the text to be logged.

void Warn(string applicationName, string message)

Logs a warning message in the file defined. The applicationName defines the application and the message holds the text to be logged.