Learn how to view, understand, and manage the logs generated by AI Content Writer.
Logs help you:
- Monitor campaign activity
- Diagnose errors and API issues
- Understand what the plugin is doing behind the scenes
- Keep your database clean and performant over time
Table of Contents
- Overview
- Where Logs Come From
- Accessing Logs in the Admin
- Understanding Log Entries
- Filtering and Searching Logs
- Automatic Log Cleanup
- Using Logs for Troubleshooting
- Best Practices
- Examples
- Related Topics
Overview
AI Content Writer records key actions and events in a dedicated Logs system, powered by a custom post type and admin list table (see includes/Admin/ListTables/LogsListTable.php and related classes).
These logs are especially useful when:
- Setting up new campaigns
- Debugging API issues (Gemini, ChatGPT, Pexels)
- Tracking cron jobs and automation
- Ensuring everything runs reliably at scale
Where Logs Come From
Logs are created by various parts of the plugin, for example:
- Cron class (
includes/Cron.php)- When generating titles, content, thumbnails, and publishing posts
- When cleaning up old logs
- Campaign processing functions (
includes/functions.php,includes/Campaigns/*.php)- When scraping sources
- When generating AI content
- When skipping duplicates or blocked items
- Admin actions
- When you manually trigger or change campaigns (depending on implementation)
Most log entries are created via a helper such as ai_content_writer()->create_log(...) with a message, status, and related campaign or post ID.
Accessing Logs in the Admin
Logs Menu
- Log in to your WordPress admin area
- Navigate to AI Content Writer → Logs
This opens a custom Logs screen powered by a list table class (AIContentWriter\Admin\ListTables\LogsListTable).
Logs Screen Layout
On the Logs page, you’ll typically see:
- A table of log entries
- Columns like Date, Message, Type/Status, Campaign, Post ID, or similar (depending on implementation)
- Bulk actions and filters at the top
- Pagination controls at the bottom
The exact columns may vary slightly, but the goal is always to surface what happened, when, and for which campaign/post.
Understanding Log Entries
Each log entry usually includes:
- Date/Time – When the action was logged
- Message – Human-readable description of what happened
- Type / Status – e.g.,
success,error,warning,info - Related Campaign – ID or title of the campaign involved (if any)
- Related Post – ID or title of the post involved (if any)
Typical Success Messages
Examples of successful log messages you might see:
X posts titles and source links generated successfully.Content generated successfully for post #123.Thumbnail generated successfully for post #123.Published 3 posts for campaign #456.Old logs cleaned up successfully.
These indicate that the automation pipeline (titles → content → thumbnails → publish → cleanup) is running as expected.
Typical Error/Warning Messages
Examples of error or warning logs:
Failed to fetch RSS feed from URL: ...Gemini API error: ...OpenAI API error: ...No results found for keywords: ...Skipping duplicate post for title: ...
Use these entries as starting points when troubleshooting issues.
Filtering and Searching Logs
The Logs screen usually supports common list table interactions:
Screen Options
At the top-right of the screen, the Screen Options tab lets you:
- Control how many logs to show per page
- This value is stored via the
set-screen-optionfilter (seeAdmin::screen_option()inincludes/Admin/Admin.php)
Column Sorting
You can often click on certain column headers (like Date) to sort logs in ascending or descending order.
Search
If a search box is present:
- You can search by keywords in log messages
- Useful for finding specific error types or campaign references
Filtering by Type or Campaign
Depending on the implementation of LogsListTable, you may see:
- Dropdown filters by log type/status
- Dropdown filters by campaign
Use these to narrow down the logs relevant to a specific problem.
Automatic Log Cleanup
To prevent your database from growing indefinitely, AI Content Writer includes an automatic log cleanup routine in includes/Cron.php.
Cleanup Cron Job
In the Cron class:
- A scheduled hook (e.g.,
aicw_cleanup_logs) is registered inschedule_cron() - This hook is typically run daily
- It calls a method like
Cron::cleanup_logs()
What Cleanup Does
Cleanup may:
- Delete logs older than a certain age (e.g., 30 or 90 days)
- Limit logs to a maximum number of entries
- Remove only certain log types (e.g., verbose
infologs) while keepingerrorlogs longer
The exact behavior depends on your current plugin version. You can inspect
Cron::cleanup_logs()inincludes/Cron.phpfor details.
Manual Cleanup (If Needed)
If you ever need to clean logs manually:
- Go to AI Content Writer → Logs
- Use bulk actions to delete selected logs (if enabled)
- Or run a one-off custom script/query (advanced, developer-only)
For safety, always back up your database before running manual queries.
Using Logs for Troubleshooting
When something isn’t working as expected, the Logs screen should be your first stop.
Common Scenarios
1. Campaign Not Generating Posts
Check logs for messages like:
No results found for keywords(Articles/Gemini/ChatGPT)Failed to fetch RSS feed(RSS campaigns)Campaign is paused or disabledAPI errorfor Gemini or ChatGPT
Use this information to:
- Adjust keywords or feed URLs
- Fix API keys or quotas
- Reactivate campaigns
2. Thumbnails Not Appearing
Look for messages related to thumbnails:
Thumbnail generated successfully for post #IDFailed to download image from Pexels
Then:
- Verify Pexels API keys
- Check media upload permissions
- Confirm your site can connect to external hosts
3. Cron Jobs Not Running
If you suspect cron isn’t firing:
- Check logs for timestamps – are they being added regularly?
- If no new logs appear over time, WP-Cron may be disabled or blocked
- Consider setting up a real server cron job to hit
wp-cron.php
4. API Quota or Error Issues
Logs often capture error messages returned by external APIs:
Gemini API error: quota exceededor similarOpenAI API error: invalid API keyorinsufficient_quota
Use these to:
- Update or correct API keys
- Upgrade your plan or reduce usage
- Implement backoff or reduced posts per run
Best Practices
Regularly Review Logs
- Set a schedule to check logs (e.g., weekly)
- Focus on error and warning entries
- Use logs to catch problems before they impact your site visitors
Keep Logs for a Reasonable Time
- Rely on the built-in cleanup to avoid unbounded growth
- If needed, adjust cleanup logic (developer-level customization)
- Consider exporting important logs before they’re purged
Use Logs When Changing Settings
Whenever you:
- Add new campaigns
- Change API keys
- Modify frequency or posts per run
…keep an eye on logs for a while to ensure the new configuration works as expected.
Avoid Debug Logging on Production (Unless Needed)
- If you enable extra debugging or verbose logging for troubleshooting, remember to disable it afterward
- Excessive logs can impact performance and disk usage
Examples
Example 1: Debugging RSS Feed Issues
Problem: RSS Feed campaign not generating posts.
Steps:
- Go to AI Content Writer → Logs
- Filter by the relevant campaign (if filter is available)
- Look for messages like:
Failed to fetch RSS feed from URL: ...RSS feed returned empty or invalid XML
- Based on the message:
- Test the feed URL directly in a browser
- Replace the feed URL with a known good feed
- Check if your server can access the host (no firewall/DNS issues)
Example 2: Diagnosing Gemini API Errors
Problem: Gemini campaign not generating content.
Steps:
- Check Logs for entries tagged with the Gemini campaign
- Look for messages like:
Gemini API error: invalid API keyGemini API error: quota exceeded
- Actions:
- Correct the API key in Settings → API Settings → Gemini
- If quota exceeded, reduce posts per run, reduce active campaigns, or upgrade your plan
Example 3: Confirming Automation Runs
Scenario: You want to make sure cron jobs are running on schedule.
Steps:
- Review logs for messages such as:
X posts titles and source links generated successfully.Content generated successfully for post #ID.Thumbnail generated successfully for post #ID.Published X posts for campaign #ID.
- Check timestamps:
- Are they appearing roughly at your configured intervals (e.g., hourly)?
- If not, investigate WP-Cron or server cron configuration.
Related Topics
- Understanding Campaigns
- How to Create a New Campaign
- Configuring Article Campaigns
- Configuring RSS Feed Campaigns
- Configuring Gemini Campaigns
- Configuring ChatGPT Campaigns
- Content Filtering & Customization
- Troubleshooting Common Issues
Last Updated: November 28, 2025 | Plugin Version: 2.1.0