Skip to main content

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

  1. Log in to your Magento Admin panel
  2. Navigate to Stores > Configuration
  3. In the left panel, expand Byte8
  4. 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:

  1. Navigate to Stores > Configuration > Byte8 > Profile Configuration
  2. Expand the Profile Settings section
  3. Enter the number of days in Profile history lifetime field
  4. Click Save Config
  5. Clear cache: bin/magento cache:flush

Recommended Values:

EnvironmentRecommended DaysReasoning
Development3-7 daysLimited history needed for testing
Staging7-14 daysEnough history for debugging
Production30-90 daysExtended 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
Database Maintenance

Profile history tables can grow large in high-volume environments. Regular cleanup is essential for optimal performance.

Custom Retention

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:

LevelNumeric ValueDescriptionExample
DEBUG100Detailed debugging informationAPI request/response details
INFO200Informational messagesProfile started, completed successfully
NOTICE250Normal but significant events100 invoices synchronized
WARNING300Warning messagesContact not found in FreeAgent
ERROR400Error messagesAPI connection failed
CRITICAL500Critical conditionsDatabase connection lost
ALERT550Action must be taken immediatelySystem running out of disk space
EMERGENCY600System is unusableComplete 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)
Performance Impact

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:

  1. Navigate to Stores > Configuration > Byte8 > Profile Configuration
  2. Expand the Email Notifications section
  3. Set Enable Email Notifications to Yes
  4. Configure recipient, sender, and threshold settings
  5. 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:

EnvironmentThresholdNotification Volume
DevelopmentWARNING or ERRORMedium
Production (standard)ERRORLow-Medium
Production (critical)CRITICALLow
Email Overload

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.

AspectSynchronous (Disabled)Asynchronous (Enabled)
Profile PerformanceSlower (waits for logging)Faster (queued)
Notification DelayImmediate1-5 minutes
System LoadHigher (inline processing)Lower (distributed)
Best ForLow-volume, developmentProduction, 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 JobSchedulePurpose
byte8_notification_cleanupDaily at 2:00 AMClean old notifications
byte8_notification_send_batch_emailsEvery 15 minutesSend batch email summaries
byte8_notification_mark_emailedEvery 5 minutesMark notifications as emailed
byte8_profile_queue_cleanupDaily at 2:15 AMClean old queue records

Next Steps

  1. About Profiles - Understand profile system
  2. Contact Export - Configure contact synchronization
  3. Invoice Export - Configure invoice processing
  4. CLI Commands - Manage configuration via CLI