Currently feedback messages after importing a feed are only provided through drupal_set_message(). As we use this great module in an automated environment we would like to get these messages about the number of created or updated items in the watchdog table.

I have include a patch with this issue that applies the necessary changes to the FeedsNodeProcessor and FeedsFeedNodeProcessor.

Thanks in advance,

Robin

CommentFileSizeAuthor
#2 feedmessage.png18.89 KBhanno
feeds-watchdog.patch3.27 KBrehos

Comments

rehos’s picture

Status: Active » Needs review

Changed status to needs review as I already included a patch

hanno’s picture

StatusFileSize
new18.89 KB

I am testing this. Great addition.
One remark the link to the feed in the logs is incorrect, in my situation the link 'feed' becomes
"/node/0"
It is feed 0, but for sure not node/0 :)

hanno’s picture

Found out what was happening. I am using a standalone form to import a file. The variabele $source->feed_nid is then always 0. To detect the right feed, it is in that case useful to link to import/$source->id

In the code I also propose to check for the right user access for showing messages. See #867054: Suppress status messages to anonymous users when using poormanscron

the snippet:

$message = t('There is no new content.');
}
if (user_access("administer feeds") || user_access("import $source->id feeds"))
drupal_set_message($message);
if ($source->nid ==0)
$link = l('feed '.$source->id, 'import/$source->id');//stand alone form
else
$link = l('feed '.$source->feed_nid, 'node/$source->feed_nid');//feed node
watchdog('feeds', $message, array(), WATCHDOG_INFO, $link);

hanno’s picture

#867054: Suppress status messages to anonymous users when using poormanscron will hopefully be tackled in poormanscron, so #3 user_access patch can be dismissed. $source->feed_nid part still valid.
@rehos any chance to test this?

twistor’s picture

Status: Needs review » Closed (duplicate)

7.x has custom logging. We should backport that to 6.x

See #606612: More detailed log.