feed-me
feed-me copied to clipboard
Having the possibility to set the log output folder
Description
In a cloud/containerised env. you often don't have the option to store logs directly on the server. Right now the path to save login files is hardcoded in the plugin:
public function init(): void
{
$this->logFile = Craft::$app->path->getLogPath() . '/feedme.log';
}
Would love to have the ability to set this to an external service etc. or piggy back making the getLogPath()
to be set as a config somewhere in Craft CMS.
@jan-dh thanks for reporting!
This needs to be converted to use a real logger instead of explicitly logging to a file.
That will give you the opportunity to direct it wherever you like.
I'll work on getting this implemented, stay tuned!
Similar question. We're using FeedMe in production for hourly imports from an ERP and I'm worried about those log files growing to epic sizes without manually deleting old logs…
Thanks for the bump, @markhuot. Still on my radar!
@jan-dh, @markhuot with https://github.com/craftcms/feed-me/pull/1462, I've converted the homegrown logging to a real Yii Log Target with a custom category.
With that PR, logs will be persisted to the database by default. Since it is a normal log target, if you want them as files, or anywhere, you can add a log target to you config/app.php
and narrow it to categories: ['feed-me']
.
Give it a spin with craftcms/feed-me:dev-feature/logs-as-log-targets as 5.6.0
and let me know how it works for you.
Merged and will be included in the next Feed Me 5 and 6 releases.