# Service sync logs

## Introduction

Each time that a service runs, logs are generated. These logs can be useful for diagnosing a problem with a service, or when handling sync queries.

You can choose to view summary logs for a quick snapshot of the sync status, or you can access detailed logs to view full sync history...you can even watch a sync happening in real time!

## Accessing sync summary information for a service

For any service, you can view summary details for every sync (i.e. service run) that has started in the last 24 hours. To view this information, follow the steps below:   \
\
**Step 1**\
Access the [services list](/product-documentation/patchworks-services/working-with-services/the-services-list.md):

<figure><img src="/files/MEwINZKmIiV4AMtXo6Ue" alt=""><figcaption></figcaption></figure>

{% hint style="info" %}
Please see [accessing services](/product-documentation/patchworks-services/working-with-services/accessing-services.md) if you're unsure how to get to this point.
{% endhint %}

**Step 2**\
Locate the required service and click the options ellipsis:\
![](/files/VaSgcplal6DIPH8XFwtM)

**Step 3**\
Select **view logs** from the dropdown menu:<br>

![](/files/XZfwjVeAvmlZH9FASDKa)

&#x20;...the [service summary](/product-documentation/patchworks-services/working-with-services/the-anatomy-of-a-service/service-summary.md) is displayed, showing a list of all syncs - for example:

<figure><img src="/files/dhIGnQJCUwoP3dzdnHZc" alt=""><figcaption></figcaption></figure>

<details>

<summary>What's the difference between pulled and pushed counts?</summary>

When viewing [detailed logs for a service](/product-documentation/patchworks-services/reporting-and-logging/service-sync-logs.md), you will now see **pulled count** and **pushed count** columns - for example:

![](/files/FLoC97kDXna5mv2TgHQe)

The **pulled count** is the number of records retrieved from the **source** for processing and the **pushed count** is the number of records synced to the **destination**.&#x20;

These numbers may vary for a number of reasons. For example, if a service is run manually with filters to pull all records from the last hour but a scheduled sync completed ten minutes previously, the manual sync will contain records that have already been processed so they won't be processed again.

</details>

## Accessing detailed logs for a sync

Detailed sync logs are available by navigating a bit further into the service. Here, you can view detailed information for each sync - if a sync is in progress, the associated log refreshes every five seconds, giving you a live view of what's happening. To view this information, follow the steps below:  &#x20;

**Step 1**\
Follow the steps [above](#accessing-sync-summary-information-for-a-service) to access sync summary information for the required service.

**Step 2**\
Select **more details** from the ellipses menu associated with the sync you wish to view:

<figure><img src="/files/EvSTzkcr1PSda5gbaOcx" alt=""><figcaption></figcaption></figure>

...logs for this sync are displayed:

<figure><img src="/files/dXEo6myw18VZ2BrVTYX1" alt=""><figcaption></figcaption></figure>

Here, you'll see a line-by-line log for the sync. If you're viewing this log while a sync is running, it auto-refreshes every five seconds, so you have a live view. If required, you can pause the auto-refresh by clicking the **auto-refresh is on** button (so it toggles to 'off'):\
\
![](/files/FRpDAI8yS8w75wrwGgTc)<br>

### Payload files

When a service is [run manually](/product-documentation/patchworks-services/troubleshooting/how-to-run-a-service-manually.md), options are available to store pull, push and custom script payload files:

<figure><img src="/files/ruM4ukaxZvQdFZBuK8Yj" alt=""><figcaption></figcaption></figure>

If any of these options are toggled 'on', links to the associated files will be available at the relevant point in the service log **for a period of 24 hours after the service completed**. For example:

<figure><img src="/files/JHa19ucs8D4FK58I1kaG" alt=""><figcaption></figcaption></figure>

To access these files, you'll need to send a GET request, authenticated with a [Patchworks token](broken://pages/vD2lVg6BPgiPl5msLjmg). For example:

<figure><img src="/files/m6TKYNGqoC6DoTBc2Vku" alt=""><figcaption></figcaption></figure>


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://doc.wearepatchworks.com/product-documentation/patchworks-services/reporting-and-logging/service-sync-logs.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
