-
Notifications
You must be signed in to change notification settings - Fork 140
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feedme_logs table causes 500 error because of allowed memory limit with large amount of logs #1487
Comments
I have the same issue. I run multiple feeds every night with a lots of entries. Click on the log tab causes a 500 error |
@knufri Couple of things I looked at today to workaround the issue.
$rows = Craft::$app->getDb()->createCommand()
->delete(Plugin::$plugin->logs::LOG_TABLE, 'log_time <= ' . strtotime('-1 week'))
->execute();
$this->stdout(Craft::t('plugin-handle', "Deleted $rows {rowsLabel} from the feedme_logs table.", [
'rowsLabel' => ngettext('row', 'rows', $rows)
]) . PHP_EOL, BaseConsole::FG_GREEN);
return ExitCode::OK; The log table has a |
Hello @jamesmacwhite, thanks for the infos 👍 I set the the logging value in the |
I'm thinking we should:
Does that sounds like it would address your issues @jamesmacwhite @knufri? /cc @jeffreyzant |
@timkelty Definitely all great options to reduce a large log table causing issues when loading on the front end for sure! Max age is a good one, as that's the main issue currently. Pagination will make web requests better and the others are bonuses, but welcome! |
One addition, I would consider changing the default log behaviour to errors only, the default is very verbose. I can see the reasons behind that, but it does log an awful lot by default. |
@jamesmacwhite totally agree. Once we figure out the remaining issues with logging, we'll probably publish a major version with that update since it would technically be a breaking change. |
After peeking at the code, it looks like the logs table has always been limited to 300 items. As a quick fix, I limited the query instead of the result, which which wont change the behavior, but should fix the issue with the page not loading. 5.7.0/6.3.0 have been released with this fix, along with a |
Thanks for the initial work here, it will certainly help in the short term, with the longer-term areas discussed, it should allow for more flexibility. |
Description
On a production environment trying to view the logs caused a 500 error. Turns out it was due to exceeding the max memory set for the PHP node.
I'm aware logs have now been moved back into the database.
I have updated the logging setting to be error only in production, however this potentially highlighted the need for automatic cleaning/truncating of the log table. For a site using multiple feeds which run regularly, this could quickly fill up and potentially bloat the database, along with causing an issue loading all the log data on the front end.
The text was updated successfully, but these errors were encountered: