Handlers, Log Viewer & Troubleshooting
Logging Handlers
Database Logging
The database handler stores log entries in your WordPress database. When activated, a Log Viewer menu item appears in the ASA2 admin menu.
| Setting | Description |
|---|---|
| Activate | Enable database logging. |
| Retention (Days) | How many days to keep log entries. Default: 30. Set to 0 to disable automatic cleanup. |
| Minimum Level | Only log entries at this level or above are saved. Default: INFO. |
BetterStack (Logtail)
Sends log entries to BetterStack's cloud-based log management platform.
License required
BetterStack integration requires a valid ASA2 Advanced Log license.
| Setting | Description |
|---|---|
| Activate | Enable BetterStack logging. |
| Source Token | Your BetterStack source token. Found in BetterStack under Sources → your source → Source token. |
| Minimum Level | Only log entries at this level or above are sent to BetterStack. Default: INFO. Recommended: WARNING or ERROR to avoid excessive data volume. |
Sentry
Sends errors and exceptions to Sentry for error tracking.
License required
Sentry integration requires a valid ASA2 Advanced Log license.
| Setting | Description |
|---|---|
| Activate | Enable Sentry error tracking. |
| DSN | Your Sentry Data Source Name. Found in Sentry under Project Settings → Client Keys (DSN). |
| Environment | Environment label for filtering in Sentry (e.g., production, staging, development). Default: production. |
| Minimum Level | Only log entries at this level or above are sent to Sentry. Default: INFO. Recommended: WARNING or ERROR. |
Slack
Sends formatted notifications to a Slack channel via an Incoming Webhook.
License required
Slack integration requires a valid ASA2 Advanced Log license.
| Setting | Description |
|---|---|
| Activate | Enable Slack notifications. |
| Webhook URL | Your Slack Incoming Webhook URL. See Creating a Slack Webhook below. |
| Channel | Target Slack channel (e.g., #asa2-logs). Optional — if not specified, the webhook's default channel is used. |
| Username | Bot name displayed in Slack. Default: ASA2 Log. |
| Minimum Level | Only log entries at this level or above trigger a notification. Default: INFO. Recommended: WARNING or ERROR to avoid notification fatigue. |
Log Levels
The plugin supports eight standard log levels, from least to most severe:
| Level | Description |
|---|---|
| DEBUG | Detailed diagnostic information for development. |
| INFO | Informational messages about normal operation. |
| NOTICE | Normal but noteworthy events. |
| WARNING | Warning conditions that may indicate a problem. |
| ERROR | Error conditions — something went wrong. |
| CRITICAL | Critical conditions requiring immediate attention. |
| ALERT | Action must be taken immediately. |
| EMERGENCY | System is unusable. |
Each logging destination has its own minimum level setting. A destination only receives log entries at or above its configured level. This allows you to optimize costs and reduce noise — for example:
- Database: Set to DEBUG or INFO for comprehensive local logs.
- BetterStack: Set to WARNING to capture only potential issues.
- Sentry: Set to ERROR to focus on actual errors.
- Slack: Set to CRITICAL for urgent notifications only.
Log Viewer
When database logging is activated, the Log Viewer provides a web-based interface to browse and search your log entries.
Accessing the Log Viewer
Go to ASA2 → Log Viewer in your WordPress admin.
Features
- Sortable table with columns: Time, Level (color-coded), Channel, Message
- Full-text search across log messages and context data
- Filter by level — Show only entries of specific levels (e.g., only errors)
- Filter by channel — Show only entries from specific logging channels
- Expandable details — Click a log entry to see its full context and extra data
- Pagination with adjustable entries per page (1–200)
- Search highlighting — Search terms are highlighted in results
Controls
| Control | Description |
|---|---|
| Auto-Refresh | When enabled, the log viewer automatically refreshes every 30 seconds. Your preference is saved in your browser. |
| Refresh | Manually refresh the log entries. |
| Dark Mode | Toggle a dark theme for the log viewer. Your preference is saved in your browser. |
| Menu Toggle | Collapse the ASA2 sidebar to give the log viewer more screen space. Your preference is saved in your browser. |
| Clear All Logs | Delete all log entries from the database. A confirmation dialog appears before deletion. |
Setting Up External Services
Creating a BetterStack Source
- Sign up or log in at betterstack.com.
- Go to Logs → Sources → Connect source.
- Choose a platform (e.g., HTTP / JSON).
- Copy the Source Token and paste it into the plugin settings.
Creating a Sentry Project
- Sign up or log in at sentry.io.
- Create a new project (choose PHP as the platform).
- Go to Project Settings → Client Keys (DSN).
- Copy the DSN and paste it into the plugin settings.
Creating a Slack Webhook
- Go to api.slack.com/apps and click Create New App → From scratch.
- Name the app (e.g., "ASA2 Logs") and select your workspace.
- Under Features, click Incoming Webhooks and toggle it on.
- Click Add New Webhook to Workspace and select the channel where notifications should be posted.
- Copy the Webhook URL and paste it into the plugin settings.
Recommended Configurations
Basic Setup (Database Only)
For most users, database logging is sufficient:
- Enable the plugin under General settings.
- Activate Database Logging with the default settings.
- Use the Log Viewer to monitor your ASA2 activity.
Production Setup (Multiple Destinations)
For production sites where reliability matters:
- Database: Level INFO, retention 30 days — comprehensive local logs.
- Slack: Level ERROR — immediate notifications when something breaks.
- Sentry (optional): Level WARNING — track and group recurring issues.
High-Volume Site
For sites with heavy traffic where log volume is a concern:
- Database: Level WARNING, retention 7 days — keep only potential issues locally.
- BetterStack: Level WARNING — centralized cloud storage with search and alerting.
- Slack: Level CRITICAL — only the most urgent issues trigger notifications.
Troubleshooting
No log entries appear in the Log Viewer
- Check the master toggle: Make sure the plugin is activated in General → Activate Plugin.
- Check database logging: Make sure Database Logging → Activate is enabled.
- Check the minimum level: If set to ERROR, only error-level messages and above are recorded. Try setting it to DEBUG temporarily to see all messages.
- Trigger a log entry: Perform an action in ASA2 that generates a log message (e.g., refreshing product data).
BetterStack is not receiving logs
- Verify the source token: Make sure the token matches exactly what BetterStack shows in your source settings.
- Check the minimum level: If set to ERROR but ASA2 is only logging INFO messages, no entries will be sent.
- Check your server's outgoing connections: Some hosting providers block outgoing HTTPS requests. Contact your host if you suspect this.
Slack notifications are not arriving
- Verify the webhook URL: Make sure the full URL is pasted, starting with
https://hooks.slack.com/. - Check the channel: If you specified a channel, make sure the Slack app has been invited to that channel.
- Check the minimum level: Set to WARNING or lower temporarily to test.
- Test the webhook: You can test the webhook directly by visiting your Slack app's webhook settings page.
Sentry is not receiving events
- Verify the DSN: Make sure the full DSN URL is pasted correctly.
- Check the environment: Verify the environment name matches what you use in Sentry's filters.
- Check the minimum level: Sentry typically works best at WARNING or ERROR level.
Database is growing too large
- Reduce retention: Lower the retention days in Database Logging → Retention (Days).
- Increase minimum level: Set to WARNING or ERROR to reduce the number of stored entries.
- Clear logs: Use the Clear All Logs button in the Log Viewer for an immediate cleanup.

