Users can specify a log directory for messages that have caused errors. These logs contain the messages' data to help you review and recover records.
Prerequisites
First, you will need to either set up DataSync for ServiceNow manually or install the DataSync for ServiceNow app.
Procedure
To add an Error Directory follow these steps:
Access your agent.xml configuration file
Navigate to the directory where you saved your agent.xml file when installing your DataSync Agent.
Add the <error_directory> directive
Place the tag <error_directory></error_directory> within the agent.xml.
For example: <error_directory>../errors</error_directory> will create a directory named errors at the base Agent directory. See more examples below.
Save your agent.xml and restart your agent
Examples
Task Level
Place the <error_directory> directive within the <task> brackets. Defining it explicitly (or avoiding it) for each task. You can do this if you want to configure different error directories per task / queue.
<?xml version="1.0" encoding="ISO-8859-1" standalone="no"?> <config> <agent> <subscribe> <task> <task_name>example_subscribe_foo</task_name> <message_connection user="example" password="XXXX" queue="YYYY">amqps://example.perspectium.net</message_connection> <instance_connection user="foo" password="XXXX">https://foo.service-now.com</instance_connection> <handler>com.perspectium.replicator.sql.SQLSubscriber</handler> .... <error_directory>../errorsFoo</error_directory> </task> <task> <task_name>example_subscribe_bar</task_name> <message_connection user="example" password="XXXX" queue="ZZZZ">amqps://example.perspectium.net</message_connection> <instance_connection user="bar" password="XXXX">https://bar.service-now.com</instance_connection> <handler>com.perspectium.replicator.sql.SQLSubscriber</handler> .... <error_directory>../errorsBar</error_directory> </task> </subscribe> <max_reads_per_connect>2000</max_reads_per_connect> <polling_interval>5</polling_interval> </agent> </config>
Agent Level
Place the <error_directory> directive within the <agent> level to have all the tasks inherit this behavior. You can do this if you just want one single error directory for all your tasks / queues.
<?xml version="1.0" encoding="ISO-8859-1" standalone="no"?> <config> <agent> <subscribe> <task> <task_name>example_subscribe_foo</task_name> <message_connection user="example" password="XXXX" queue="YYYY">amqps://example.perspectium.net</message_connection> <instance_connection user="foo" password="XXXX">https://foo.service-now.com</instance_connection> <handler>com.perspectium.replicator.sql.SQLSubscriber</handler> .... </task> <task> <task_name>example_subscribe_bar</task_name> <message_connection user="example" password="XXXX" queue="ZZZZ">amqps://example.perspectium.net</message_connection> <instance_connection user="bar" password="XXXX">https://bar.service-now.com</instance_connection> <handler>com.perspectium.replicator.sql.SQLSubscriber</handler> .... </task> </subscribe> <error_directory>../errors</error_directory> <max_reads_per_connect>2000</max_reads_per_connect> <polling_interval>5</polling_interval> </agent> </config>