> For the complete documentation index, see [llms.txt](https://docs.pharos.ai/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.pharos.ai/configuration-guide/connected-orgs/connected-orgs-broadcast-tutorial.md).

# Tutorial: Broadcast Logs to a Hub Org

Step-by-step: connect a source org to a central hub org so Pharos broadcasts its logs there, then verify a real error arrives on the hub.

This tutorial connects two Salesforce orgs so that logs created in one are copied to the other. You'll set up both ends of the connection, authenticate it, and then trigger a real error to watch it arrive.

The scenario uses two orgs:

* **EU Sales Org**: the **source**. It's where the business process runs and errors happen. It keeps its own logs and also *sends* a copy of each one to the hub.
* **Monitoring Hub**: the **target**. It *receives* logs from one or more source orgs, so your team can watch every environment in one place.

This is a **Broadcast** setup: the source keeps its logs locally *and* sends them on. (With Passthrough Mode, the source would stop keeping them locally. This tutorial leaves Passthrough Mode off.)

Watch the full walkthrough, or follow the steps below.

{% embed url="<https://demo.arcade.software/1q2nKXSZ11q0vZT3LTgk?embed>" %}

{% hint style="info" %}
For the concepts behind connected orgs and other topologies, see [Connected Orgs](https://docs.pharos.ai/configuration-guide/connected-orgs.md).
{% endhint %}

***

## Before You Start

* **Pharos is installed in both orgs.** See [Package Installation](https://docs.pharos.ai/configuration-guide/the-basics/package-installation.md).
* **You have an admin login for each org.** In the source org you'll sign in to the hub once, to authorize the connection.
* **Use production, sandbox or Developer Edition orgs.** Scratch orgs can't host the External Client App that a cross-org connection needs, so they aren't supported.

{% hint style="warning" %}
**Follow the steps in order.** Set up the hub's *Receive from this org* record first, then the source's *Send to this org* record, then authenticate from the source. The hub should be ready to receive before the source starts sending.
{% endhint %}

***

## Step 1: Note Both Org IDs

Each side of the connection identifies the other by its Salesforce **Organization ID**.

In each org, open **Setup**, search for **Company Information**, and copy the **Organization ID**. Keep both handy:

| Org                        | Used on                                  |
| -------------------------- | ---------------------------------------- |
| EU Sales Org (source) ID   | The hub's *Receive from this org* record |
| Monitoring Hub (target) ID | The source's *Send to this org* record   |

***

## Step 2: Hub: Receive From the Source

In the **Monitoring Hub**, open **Pharos Admin → Connected Orgs** and click **New**.

| Field          | Value                                                                         |
| -------------- | ----------------------------------------------------------------------------- |
| Name           | `EU Sales Org`                                                                |
| Description    | Anything that helps you recognise the source                                  |
| Org Type       | **Production** (the default is Sandbox, so change it for a production source) |
| Data Direction | **Receive from this org**                                                     |
| Mode           | Set automatically to **Broadcast Only**                                       |
| Org Id         | The **EU Sales Org** Organization ID                                          |

Click **Save**.

![Hub org: New connected org form named EU Sales Org, Data Direction Receive from this org, Mode Broadcast Only, and the source's Org Id](https://4264222071-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fdl9tmJ56lvwg5XY63QYr%2Fuploads%2Fgit-blob-52a4040229eb073f8f01dc67a6894710fe95f581%2Fbroadcast-hub-receive-form.png?alt=media)

{% hint style="info" %}
**The Name you choose here is how the hub labels incoming logs.** Every log received from this source shows it in the **Organization Name** field, so pick something your team will recognise.
{% endhint %}

The hub doesn't need to log in to the source. For broadcast, the source does all the sending.

***

## Step 3: Source: Send to the Hub

In the **EU Sales Org**, open **Pharos Admin → Connected Orgs** and click **New**.

| Field          | Value                                         |
| -------------- | --------------------------------------------- |
| Name           | `Monitoring Hub`                              |
| Description    | Anything that helps you recognise the hub     |
| Org Type       | **Production** (or Sandbox, to match the hub) |
| Data Direction | **Send to this org**                          |
| Org Id         | The **Monitoring Hub** Organization ID        |

Leave **Enable Filters** off to send every log. You can [add filters](https://docs.pharos.ai/configuration-guide/connected-orgs.md#filtering-whats-sent) later.

Click **Save**. Save before you authenticate: the next step works from the saved record.

![Source org: New connected org form named Monitoring Hub, Data Direction Send to this org, and the hub's Org Id](https://4264222071-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fdl9tmJ56lvwg5XY63QYr%2Fuploads%2Fgit-blob-9639f84a5e142ce99af3195292b01d39c399d296%2Fbroadcast-source-send-form.png?alt=media)

***

## Step 4: Source: Authenticate to the Hub

Still in the **EU Sales Org**, click **edit** on the **Monitoring Hub** row.

1. Make sure **Use Client App Authentication** is on.
2. Click **Check**. The External Client App that the hub created in Step 2 can take several minutes to become available. Until then Pharos shows *"External client is not yet available for use"*. Wait a few minutes and click **Check** again.
3. When the button changes to **Login to Org**, click it.
4. In the window that opens, sign in to the **Monitoring Hub** as an admin, then click **Allow** on the **Allow Access?** screen.

The window closes and the **OAuth Token** is stored, shown masked with a **Reset** button.

![Source org: Monitoring Hub connection with Use Client App Authentication on and a masked OAuth Token with a Reset button](https://4264222071-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fdl9tmJ56lvwg5XY63QYr%2Fuploads%2Fgit-blob-69d7057eb994c9aac8a65eb4aab9106155046d60%2Fbroadcast-source-token-stored.png?alt=media)

The connection is now live.

***

## Step 5: Verify a Log Arrives on the Hub

Create a log in the **EU Sales Org**. Any error Pharos captures will do: an Apex exception, a failed Flow, or a log written with [Triton](https://triton.pharos.ai).

On the source, open **Logs**. The new log's **Broadcast Status** changes from **Needed** to **Completed** once it has been sent. This usually takes under a minute.

![Source org: All Logs list showing the discount error log with Broadcast Status Completed](https://4264222071-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fdl9tmJ56lvwg5XY63QYr%2Fuploads%2Fgit-blob-38d72d21a899825c5a2d5dd91da4d385a9716fdb%2Fbroadcast-source-log-completed.png?alt=media)

On the hub, open **Logs**. The same log is there with:

* **Organization Name**: the name of the hub's *Receive from this org* record (`EU Sales Org`)
* **Originated From**: **Broadcast**

![Hub org: Logs list filtered to broadcast logs, showing the error received from EU Sales Org with Originated From Broadcast](https://4264222071-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fdl9tmJ56lvwg5XY63QYr%2Fuploads%2Fgit-blob-a5a3356f0422618a7f6fc9dc2d78a5bce01f3a16%2Fbroadcast-hub-received-logs.png?alt=media)

{% hint style="success" %}
**Tip:** On the hub, create a list view filtered on **Originated From** equals **Broadcast**, with **Organization Name** as a column. That gives you one place to see logs from every connected org.
{% endhint %}

***

## Troubleshooting

If a log doesn't reach the hub, see [Connected Orgs troubleshooting](https://docs.pharos.ai/configuration-guide/connected-orgs.md#troubleshooting).

{% hint style="warning" %}
**Don't put Login IP Ranges on the hub user's profile.** The source refreshes its token from Salesforce's servers, which fall outside those ranges, so broadcasting stops with `invalid_grant` / `ip restricted`.
{% endhint %}

{% hint style="success" %}
**Next Step:** Add more source orgs to the same hub by repeating Steps 2–4 for each one, or route the hub's logs to your team with [Integrations](https://docs.pharos.ai/configuration-guide/integrations.md).
{% endhint %}
