Write Messages to the Log
All of the fetch action methods you can override in ConnectorBase
are passed a task
object with a Log
member - accessed through getLog()
. This allows you to log messages at a variety of levels:
task.getLog().writeln(Log.ALWAYS, "This message will always be logged"); task.getLog().writeln(Log.CRITICAL, "This is logged at the critical level"); task.getLog().writeln(Log.ERROR, "Errors are logged at this level"); task.getLog().writeln(Log.WARNING, "Warnings are logged at this level"); task.getLog().writeln(Log.NORMAL, "This is the normal level of verbosity for logs"); task.getLog().writeln(Log.FULL, "Verbose logging"); task.getLog().writeln(Log.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 writeln
, 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 |
---|---|---|
|
SynchronizeTask | Synchronize |
|
SynchronizeIdsTask | Synchronize |
|
SynchronizeGroupsTask | SynchronizeGroups |
|
CollectTask | Collect |
|
DeleteTask | Delete |
|
InsertTask | Insert |
|
UpdateTask | Update |
|
ViewTask | View |
|
HoldTask | Hold |
ConnectorLib Java also has a "Java" log stream. This log contains information about the Java version being used, the class path and connector being used, and any Java errors.