Debugging Feeds
Drupal 7 will no longer be supported after January 5, 2025. Learn more and find resources for Drupal 7 sites
Feeds can be a difficult module to debug, both because the actual imports run either as batch processes or on cron, and because there are several layers of abstraction in the module (cf. the description of the class hierarchy on the main Feeds for Developers page).
This page is a work in progress, intended for sharing tricks on how to debug Feeds.
1)Feeds Debug Tamper
The Feeds Debug Tamper module is a somewhat hard to find tool but it provides logging without writing code. It works with the Feeds Tamper module to do this. Proposed documentation for doing this can be found at https://www.drupal.org/node/2832831.
2) Use the feeds_dbg() logging function.
Enable the hidden feeds_debug variable, i.e., drush vset feeds_debug TRUE.
This will log to a file in the temporary directory specified in your file system settings - for example, /tmp/feeds_www.example.com.log.
By default the only thing logged is PubSubHubbub, but you could add feeds_dbg() calls to other parts of the module for logging of where you are having problems.
The advantage of using this vs. the dd() function in Devel is that you can continue doing it on a production site (which you wouldn't want to do with Devel).
The function will pretty-print arrays using var_export(). Otherwise, it just prints out strings normally.
3) Add enhanced logging to the module.
There is a patch in #606612: More detailed log to improve the logging when Feeds nodes are imported, by adding a Views 3-based log.
At the bottom of that issue, there is a quick-and-dirty approach using watchdog(), but it needs improvement to be fully functional.
4) See what importer settings are currently defined.
The following code which you can add to a node, a custom module, or /devel/php, if you are running Devel module, shows you what all the configuration settings are for the currently defined importers.
// load all importers using the CTools plugins API
$importers = feeds_importer_load_all();
// each importer contains a pointer to the FeedsFetcher, FeedsParser, and FeedsProcessor classes being used
// this will show the configuration for each, as well as the base importer
foreach($importers as $importer) {
dpm($importer->getConfig());
}
4) Feeds Import Preview
This module allows you to see what your source looks like after it has been parsed.
Help improve this page
You can:
- Log in, click Edit, and edit this page
- Log in, click Discuss, update the Page status value, and suggest an improvement
- Log in and create a Documentation issue with your suggestion