Profile Configuration
Profile Configuration controls how Magento FreeAgent Integration manages synchronization profiles, including history retention and notification settings. Profiles are the core mechanism for managing data synchronization between Magento 2 and FreeAgent.
Accessing Profile Configuration
- Log in to your Magento Admin panel
- Navigate to Stores > Configuration
- In the left panel, expand Byte8
- Select Profile Configuration
Profile Settings
Profile History Lifetime
Field: history_lifetime
Path: byte8_profile/profile_config/history_lifetime
Type: Text (numeric)
Default: 7 days
Scope: Global
Controls how long profile execution history is retained in the database.
Description: Number of days a profile history should be kept for. After this period, old profile execution records are automatically purged to maintain database performance.
Configuration Steps:
- Navigate to Stores > Configuration > Byte8 > Profile Configuration
- Expand the Profile Settings section
- Enter the number of days in Profile history lifetime field
- Click Save Config
- Clear cache:
bin/magento cache:flush
Recommended Values:
| Environment | Recommended Days | Reasoning |
|---|---|---|
| Development | 3-7 days | Limited history needed for testing |
| Staging | 7-14 days | Enough history for debugging |
| Production | 30-90 days | Extended history for auditing and troubleshooting |
What Gets Stored in Profile History:
- Profile execution start/end times
- Processed entity counts
- Error messages and warnings
- Processing status and results
- API request/response logs
Storage Impact:
Average storage per profile execution: 1-5 MB
Daily synchronizations: 24 executions (hourly)
30-day retention: ~720-3,600 MB per profile
Profile history tables can grow large in high-volume environments. Regular cleanup is essential for optimal performance.
For compliance or audit requirements, you can set longer retention periods (90-365 days). Consider implementing database archiving for very long retention periods.
Manual Cleanup:
# Purge profile history data
bin/magento profile:data:purge
Profile Notifications
Profile Notifications allow you to monitor profile executions and receive alerts when issues occur.
General Settings
Enable Notifications
Field: enabled
Path: byte8_profile_notification/general/enabled
Type: Yes/No
Default: No
Scope: Global
Master switch for the profile notification system.
Description: When enabled, Magento FreeAgent Integration will log profile notifications and can send email alerts based on configured thresholds.
Minimum Log Level
Field: log_level
Path: byte8_profile_notification/general/log_level
Type: Select
Scope: Global
Depends on: enabled = Yes
Determines which notification levels are logged.
Available Levels:
| Level | Numeric Value | Description | Example |
|---|---|---|---|
| DEBUG | 100 | Detailed debugging information | API request/response details |
| INFO | 200 | Informational messages | Profile started, completed successfully |
| NOTICE | 250 | Normal but significant events | 100 invoices synchronized |
| WARNING | 300 | Warning messages | Contact not found in FreeAgent |
| ERROR | 400 | Error messages | API connection failed |
| CRITICAL | 500 | Critical conditions | Database connection lost |
| ALERT | 550 | Action must be taken immediately | System running out of disk space |
| EMERGENCY | 600 | System is unusable | Complete system failure |
Recommended Settings:
# Development
Minimum Log Level: DEBUG (log everything)
# Staging
Minimum Log Level: INFO (log general operations)
# Production
Minimum Log Level: WARNING (log only issues)
Lower log levels (DEBUG, INFO) generate more database records. Use WARNING or ERROR in production to minimize storage and performance impact.
Retention Period
Field: retention_days
Path: byte8_profile_notification/general/retention_days
Type: Text (numeric)
Default: 30 days
Scope: Global
Depends on: enabled = Yes
Number of days to keep notifications in the database.
Maximum Notifications
Field: max_notifications
Path: byte8_profile_notification/general/max_notifications
Type: Text (numeric)
Default: 10,000
Scope: Global
Depends on: enabled = Yes
Maximum number of notifications to keep in the database. When this limit is reached, oldest notifications are automatically deleted regardless of retention period.
Email Notifications
Configure email alerts for profile execution events and errors.
Enable Email Notifications
Field: enabled
Path: byte8_profile_notification/email/enabled
Type: Yes/No
Default: No
Scope: Global
Enables sending email notifications for profile events.
Configuration Steps:
- Navigate to Stores > Configuration > Byte8 > Profile Configuration
- Expand the Email Notifications section
- Set Enable Email Notifications to Yes
- Configure recipient, sender, and threshold settings
- Click Save Config
Recipient Email(s)
Field: recipient
Path: byte8_profile_notification/email/recipient
Type: Text (email)
Required: Yes (when email notifications enabled)
Scope: Global
Email addresses to receive profile notifications. Comma-separated for multiple recipients.
# Single recipient
admin@example.com
# Multiple recipients
admin@example.com,devteam@example.com,support@example.com
Email Sender
Field: sender
Path: byte8_profile_notification/email/sender
Type: Select
Scope: Global
Magento email identity used as the sender for notifications (General Contact, Sales Representative, etc.).
Email Threshold
Field: threshold
Path: byte8_profile_notification/email/threshold
Type: Select
Scope: Global
Minimum severity level required to trigger email notifications.
Recommended Settings:
| Environment | Threshold | Notification Volume |
|---|---|---|
| Development | WARNING or ERROR | Medium |
| Production (standard) | ERROR | Low-Medium |
| Production (critical) | CRITICAL | Low |
Setting threshold too low (DEBUG, INFO) can result in hundreds of emails per day. Start with ERROR and adjust as needed.
Send Critical Errors Immediately
Field: real_time_critical
Path: byte8_profile_notification/email/real_time_critical
Type: Yes/No
Default: Yes
Scope: Global
Sends CRITICAL and EMERGENCY level notifications immediately without waiting for batch interval.
Enable Batch Email Summary
Field: batch_enabled
Path: byte8_profile_notification/email/batch_enabled
Type: Yes/No
Default: No
Scope: Global
Groups non-critical notifications into periodic summary emails instead of individual messages.
Batch Interval
Field: batch_interval
Path: byte8_profile_notification/email/batch_interval
Type: Text (numeric)
Default: 60 minutes
Scope: Global
Depends on: batch_enabled = Yes
How often to send batch summary emails (in minutes).
Performance Settings
Batch Processing Size
Field: batch_size
Path: byte8_profile_notification/performance/batch_size
Type: Text (numeric)
Default: 100
Scope: Global
Number of notifications to process in a single batch operation during cleanup.
Enable Asynchronous Logging
Field: enable_async
Path: byte8_profile_notification/performance/enable_async
Type: Yes/No
Default: Yes
Scope: Global
Process notifications asynchronously via message queue to improve performance.
| Aspect | Synchronous (Disabled) | Asynchronous (Enabled) |
|---|---|---|
| Profile Performance | Slower (waits for logging) | Faster (queued) |
| Notification Delay | Immediate | 1-5 minutes |
| System Load | Higher (inline processing) | Lower (distributed) |
| Best For | Low-volume, development | Production, high-volume |
Configuration via CLI
# Set profile history lifetime to 30 days
bin/magento config:set byte8_profile/profile_config/history_lifetime 30
# Enable notifications
bin/magento config:set byte8_profile_notification/general/enabled 1
# Set minimum log level to WARNING
bin/magento config:set byte8_profile_notification/general/log_level 300
# Set retention period
bin/magento config:set byte8_profile_notification/general/retention_days 60
# Enable email notifications
bin/magento config:set byte8_profile_notification/email/enabled 1
bin/magento config:set byte8_profile_notification/email/recipient "admin@example.com"
# Enable batch email
bin/magento config:set byte8_profile_notification/email/batch_enabled 1
bin/magento config:set byte8_profile_notification/email/batch_interval 60
# Enable async processing
bin/magento config:set byte8_profile_notification/performance/enable_async 1
# Clear cache
bin/magento cache:flush
Best Practices
Development Environment
bin/magento config:set byte8_profile/profile_config/history_lifetime 7
bin/magento config:set byte8_profile_notification/general/enabled 1
bin/magento config:set byte8_profile_notification/general/log_level 100
bin/magento config:set byte8_profile_notification/general/retention_days 7
bin/magento config:set byte8_profile_notification/email/enabled 0
bin/magento config:set byte8_profile_notification/performance/enable_async 0
Production Environment
bin/magento config:set byte8_profile/profile_config/history_lifetime 60
bin/magento config:set byte8_profile_notification/general/enabled 1
bin/magento config:set byte8_profile_notification/general/log_level 300
bin/magento config:set byte8_profile_notification/general/retention_days 60
bin/magento config:set byte8_profile_notification/email/enabled 1
bin/magento config:set byte8_profile_notification/email/threshold 400
bin/magento config:set byte8_profile_notification/email/real_time_critical 1
bin/magento config:set byte8_profile_notification/email/batch_enabled 1
bin/magento config:set byte8_profile_notification/email/batch_interval 60
bin/magento config:set byte8_profile_notification/performance/enable_async 1
bin/magento config:set byte8_profile_notification/performance/batch_size 200
Cron Jobs
The notification system uses the following cron jobs:
| Cron Job | Schedule | Purpose |
|---|---|---|
byte8_notification_cleanup | Daily at 2:00 AM | Clean old notifications |
byte8_notification_send_batch_emails | Every 15 minutes | Send batch email summaries |
byte8_notification_mark_emailed | Every 5 minutes | Mark notifications as emailed |
byte8_profile_queue_cleanup | Daily at 2:15 AM | Clean old queue records |
Next Steps
- About Profiles - Understand profile system
- Contact Export - Configure contact synchronization
- Invoice Export - Configure invoice processing
- CLI Commands - Manage configuration via CLI