Write Messages to the Log
All of the fetch action methods you can override in ConnectorBase
are passed a task
object with a Log
object accessible with task.log()
task.log().always("This message is always logged"); task.log().critical("This is logged at the critical level"); task.log().error("Errors are logged at this level"); task.log().warning("Warnings are logged at this level"); task.log().normal("This is the normal level of verbosity for logs"); task.log().full("Verbose logging"); task.log().writeln(42, "Logged using any numeric or defined log level");
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 |