-
Notifications
You must be signed in to change notification settings - Fork 642
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
[4.x]: console command logs below warning are never logged #14280
Comments
@julianschelker The reasoning here is if you're running a console command and streaming logs to stderr/out, you'll have a mess of logs and actual command output (assuming you're running in That said, I can see how that would be confusing when expecting your own logs to show. I'm inclined to just take that condition out and just say the extra output is expected when running in |
@timkelty thanks, that would be great. I think if running a command shows too much logs then it's still possible for the user to just change the loglevel to get a cleaner output. What i'm generally a bit missing in the framework is a way to configure logLevel per classes or package like Java/Spring Backends can do this. That also helps really good to get a better overview of logs. But that's rather high-level and probably out of scope of a simple ticket, but maybe this could be considered somewhere in the future. |
@julianschelker also be aware that My PR proposes additionally proposes to not log context by default for console commands, so it looks like if you set
That's absolutely possible! In Yii, that's done with additional log targets, and customizing the target's
|
Craft 4.9 and 5.1 are out with the changes in #14434. |
What happened?
Description
Logging in console commands with level below warning is never logged. For some reason it was actively disabled, but now it can't be configured with log level anymore. This is confusing at least and doens't make much sense in my opinion.
Steps to reproduce
My app.php configures:
Expected behavior
Log is shown
Actual behavior
Log doesn't show up. The class MonologTarget:191 does not add a StreamHandler with correct logLevel incase the request is a console request. See:
Craft CMS version
Craft Pro 4.5.11.1
PHP version
No response
Operating system and version
No response
Database type and version
No response
Image driver and version
No response
Installed plugins and versions
"codemix/yii2-streamlog": "1.3.1",
"codemonauts/craft-readonly-field": "2.0.1",
"craftcms/cms": "4.5.11.1",
"craftcms/element-api": "^3.0.1.1",
"craftcms/google-cloud": "^2.0.0",
"craftcms/redactor": "^3.0.4",
"dompdf/dompdf": "^2.0.3",
"doublesecretagency/craft-cpcss": "2.6.0",
"ether/tags": "2.0.0",
"firebase/php-jwt": "5.2.0",
"google/cloud-firestore": "^1.28",
"kreait/firebase-php": "5.26.3",
"mailjet/mailjet-apiv3-php": "^1.5",
"postfinancecheckout/sdk": "^3.0",
"promphp/prometheus_client_php": "^2.2",
"vlucas/phpdotenv": "^5.4.0"
The text was updated successfully, but these errors were encountered: