Write Messages to the Log

All of the fetch action methods you can override in ConnectorBase are passed a task object with a Log property of type ILog. This allows you to log messages at a variety of levels:

       task.Log.WriteLine(LogLevel.Always,
		"This message will always be logged");	
       task.Log.WriteLine(LogLevel.Critical,
		"This is logged at the critical level");
       task.Log.WriteLine(LogLevel.Error,
		"Errors are logged at this level");
       task.Log.WriteLine(LogLevel.Warning,
		"Warnings are logged at this level");
       task.Log.WriteLine(LogLevel.Normal, 
		"This is the normal level of verbosity for logs");
       task.Log.WriteLine(LogLevel.Full, 
		"Verbose logging");
       task.Log.WriteLine(LogLevel.Debug,
		"For internal use only - these messages will never appear");

These levels correspond to the levels you can specify for the LogLevel parameter in the [Logging] section of the connector's configuration file. Messages only appear in the connector's log files if the LogLevel parameter is set to the level passed to WriteLine, or a more verbose level. For more information about the LogLevel parameter, see LogLevel.

Log Files

The connector writes each log message to one of its log streams. When an administrator deploys a connector, they can choose to write messages from each log stream to a separate file. For example, the administrator might choose to write messages from the synchronize log stream to synchronize.log, messages from the collect log stream to collect.log, and so on.

The log stream that the connector uses for a specific log message depends on the type of task that logged the message:

Method Overridden Task Type Log Stream
Synchronize ISynchronizeTask Synchronize
SynchronizeIds ISynchronizeIdsTask Synchronize
SynchronizeGroups ISynchronizeGroupsTask SynchronizeGroups
Collect ICollectTask Collect
Remove IDeleteTask Delete
Insert IInsertTask Insert
Update IUpdateTask Update
View IViewTask View
Hold IHoldTask Hold