-
-
Notifications
You must be signed in to change notification settings - Fork 436
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
Fixed the behaviour of $forceLog parameter for Mage::log() #3263
Conversation
interesting! it happened many times that I had logs disabled, wanted to log something and it didn't work... I've to think if there could be some problems with this :-) |
Perhaps it would be better to limit the error level and developer mode checks only to default Magento log file (system.log) and not to custom log files. This code seems a bit confusing to me.
|
I think not having the forcelog is the right thing, if logs are disabled nothing should be logged, unless it's forcelog (maybe it's something extremely important that should be logged anyway while we don't have to have a million php notices logged) so I think the sentiment of te PR is correct :-) |
Yes, but for me it would be better if for custom logs other than system.log only check if logging is disabled. For custom logs, I would prefer not to check the developer mode or level. |
mmmmm on that case I don't necessarily agree. I know a lot of extensions that log whatever kind of stuff that I wouldn't want to log if logs are disabled. I see your point tho, but maybe (I'll still think about it) I prefer that logs are written only if forcelog is used :-) |
yes only check if log is not disabled or is a forced log, but remove developer mode and level for custom logs |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
tested, works perfectly
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ahh so this why sometimes the forceLog won't do anything!
probably 10+ years old bug heheheh |
Some extensions use
Mage::log
to enable custom debug log files, but even if they set$forceLog = true
, the log won't be written if the level is lower (e.g. Zend_Log::INFO) and Magento is not in developer mode.