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

Missing translation categories should not be logged as Error #4109

Closed
timkelty opened this issue Apr 8, 2019 · 4 comments · Fixed by #4400
Closed

Missing translation categories should not be logged as Error #4109

timkelty opened this issue Apr 8, 2019 · 4 comments · Fixed by #4400
Labels
enhancement improvements to existing features site development 👩‍💻 features related to website/API development

Comments

@timkelty
Copy link
Contributor

timkelty commented Apr 8, 2019

If you are in the CP using a non-english lang, your logs will be littered with tons of errors:

2019-04-08 14:21:33 [-][1][-][error][yii\i18n\PhpMessageSource::loadFallbackMessages] The message file for category 'relabel' does not exist: /app/vendor/composer/anubarak/craft-relabel/src/translations/fr-CA/relabel.php Fallback file does not exist as well: /app/vendor/composer/anubarak/craft-relabel/src/translations/fr/relabel.php

…which can be annoying when you're looking for actual errors. Seems like falling back is the expected behavior, and shouldn't be logged as an error.

@brandonkelly brandonkelly added site development 👩‍💻 features related to website/API development enhancement improvements to existing features labels Apr 8, 2019
@gtettelaar
Copy link
Contributor

gtettelaar commented Jun 7, 2019

@timkelty It should be possible to override that using Yii's except property in the log option that you can set in app.php?

@timkelty
Copy link
Contributor Author

Good idea @gtettelaar, this seems to work:

                        'except' => [
                            'yii\web\HttpException:40*',
                            'yii\i18n\PhpMessageSource:*'
                        ],

@gtettelaar
Copy link
Contributor

gtettelaar commented Jun 12, 2019

@brandonkelly If this is something you would be open to having in the core via Craft::$app->getConfig()->getGeneral() i have some time to set up a PR for this - to be able to set this via one config variable rather than needing to edit app.php?

@brandonkelly
Copy link
Member

Probably safe to just ignore PhpMessageSource errors as part of the base configuration, rather than making it a config setting. If either of you have a chance to test it out and PR it, I’d be happy to accept it, even for Craft 3.1.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement improvements to existing features site development 👩‍💻 features related to website/API development
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants