# Monitoring

Monitor sync health and troubleshoot issues using built-in logging and Salesforce tools.

## Error Logs

All errors are logged to `Onboarded_Error_Log__c`. Create a list view or report to monitor:

- **Recent Errors:** Filter by CreatedDate
- **By Class:** Group by `Class_Name__c` to identify problem areas
- **By Object:** Filter by `Impacted_Object__c`


Client-side errors that occur within the Lightning Web Components (Employee Onboarded, Workflow Onboarded, and the Task Row sub-component) are also captured through `OnboardedErrorService.logComponentError` and recorded as Error Log entries.

## Apex Jobs

Monitor batch job execution:

1. Go to **Setup** → **Environments** → **Jobs** → **Apex Jobs**
2. Filter by Job Type = "Batch Apex"
3. Look for jobs starting with "Employee", "Employer", "Task", etc.
4. Check Status, Items Processed, and Failures columns


## Platform Events

The application publishes `Onboarded_Error_Event__e` platform events for real-time error monitoring. Subscribe to these events to:

- Trigger alerts via Flow
- Send notifications to Slack/Teams
- Create real-time dashboards