Sync Logs & Monitoring
Every sync run produces a structured log entry in the middleware database. These logs power the Sync Logs admin page and provide an audit trail for debugging and capacity planning.
NFusionSyncLog
Model: app/Models/NFusionSyncLog.php
Each sync run creates one NFusionSyncLog record per sync target.
| Column | Description |
|---|---|
n_fusion_tenant_id | Which tenant was synced |
n_fusion_sync_target_id | Which target received the sync |
status | running / success / partial / error |
started_at | When the sync job started |
completed_at | When it finished |
records_attempted | Total SKU count from nFusion |
records_processed | Number of SKUs successfully updated |
message | Human-readable description including a spot price summary (e.g. Spot prices: Gold A:4550.9300 B:4548.9300; Silver A:72.0540 B:71.2040; Platinum A:1893.2000 B:1883.2000.) |
spot_prices_snapshot | JSON snapshot of metal spot prices captured during this run (nullable) |
Spot Prices Snapshot
When the WooCommerce sync target successfully fetches spot prices, the normalised snapshot is persisted to the log record:
{
"gold": { "ask": 4550.93, "bid": 4548.93 },
"silver": { "ask": 72.054, "bid": 71.204 },
"platinum": { "ask": 1893.20, "bid": 1883.20 }
}
This is displayed in the Spot Prices Snapshot section of the log detail view in Filament. If the nFusion General API call failed during that run the column will be null.
NFusionSyncLogItem
Model: app/Models/NFusionSyncLogItem.php
Per-SKU detail records linked to a parent NFusionSyncLog. Created when debug_enabled = true on the sync target. Each item records:
| Column | Description |
|---|---|
n_fusion_sync_log_id | Parent log |
sku | Product SKU |
status | success or error |
message | What happened (e.g., "price updated", "SKU not found") |
data | JSON snapshot of the price data for this SKU |
Status Values
| Status | Meaning |
|---|---|
running | The job is currently in progress |
success | All attempted SKUs processed without errors |
partial | Some SKUs processed, some failed |
error | The sync failed entirely (exception thrown) |
Viewing Logs in Filament
- Navigate to nFusion → Sync Logs.
- Filter by tenant, target, status, or date range.
- Click a log entry to view per-SKU items (if debug mode was enabled).
Error Notifications
When a sync fails, PriceSyncService sends an email notification via NFusionSyncErrorMail. Configure the recipient in .env:
Healthcheck Monitoring
If a tenant has a healthcheck_url configured, a successful sync pings that URL. You can use services like Healthchecks.io to alert when syncs stop happening — for example if the queue worker goes down.
Application Logs
All sync activity is also written to Laravel's application log (typically storage/logs/laravel.log):
# Tail logs locally
tail -f storage/logs/laravel.log
# View in Vapor / CloudWatch
# Logs are sent to AWS CloudWatch when deployed on Vapor
Log channels are configured in config/logging.php.