Skip to content
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

Having the possibility to set the log output folder #1344

Closed
jan-dh opened this issue Jul 4, 2023 · 5 comments
Closed

Having the possibility to set the log output folder #1344

jan-dh opened this issue Jul 4, 2023 · 5 comments
Assignees
Labels

Comments

@jan-dh
Copy link

jan-dh commented Jul 4, 2023

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 jan-dh added the bug label Jul 4, 2023
@timkelty timkelty self-assigned this Jul 14, 2023
@timkelty
Copy link
Contributor

@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!

@markhuot
Copy link

markhuot commented Jun 4, 2024

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…

@timkelty
Copy link
Contributor

timkelty commented Jun 6, 2024

Thanks for the bump, @markhuot. Still on my radar!

@timkelty
Copy link
Contributor

timkelty commented Jun 11, 2024

@jan-dh, @markhuot with #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.

@angrybrad
Copy link
Member

Merged and will be included in the next Feed Me 5 and 6 releases.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants