-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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
Remove logging of ApplicationException #4569
Remove logging of ApplicationException #4569
Conversation
@pikanji ApplicationException was added in January 2015: octobercms/library@6a68036. Logging was added in February 2015 (7b52e07#diff-547f5794a63e9f138c33b20de8649b7eR20-R31) We'll need to get @daftspunk to make the decision on this one. |
@LukeTowers my two cents - given that it's mentioned twice that it is not meant to be logged, and it's only been added ad-hoc to the ErrorHandler to be logged, I think it's probably a safe bet it is not meant to be logged. |
This pull request will be closed and archived in 3 days, as there has been no activity in the last 30 days. If this is still being worked on, please respond and we will re-open this pull request. |
This looks like it might have been a typo, it should read To clarify the difference:
It would appear October in general needs an overall audit to ensure the correct use of these exception types is applied. It would also make sense that |
I'm leaving this open because it contains actionable information but the current code itself should not get merged; ApplicationException should be renamed to SystemException. |
@daftspunk do you mean rename the exception class itself? I use it all the time in my project's for its intended purpose, telling the user they've done something wrong. |
I mean don't log messages that tell the user they've done something wrong, only log system errors. Change code to this, but maybe look at the impact of doing so first:
|
Did a quick look through the core, all SystemException uses right now are valid, they're mostly used for cases where either the system trips on something that it can't recover from or as a "developer validation" tool (i.e. perhaps it could recover from it, but the developer should really just follow the error message to fix whatever it is they're doing wrong). |
This appears to be a typoe. It doesn't make sense to ever log "user errors", only "system errors" Fixes #4569
SystemExceptions are already logged when the System ServiceProvider listens to the Message Logged event, this code used to be for ApplicationExceptions to bypass the fact that they were explicitly ignored by October's core exception handler. ApplicationExceptions were added 27 Jan 2015 in octobercms/library@6a68036 ApplicationExceptions were explicitly ignored in the core exception handler on 16 Feb 2015 in octobercms/library@237d97d#diff-b6bf0348130fdd1311473a97536310cdR20 and were explicitly logged in the System exception handler on the same day in 7b52e07#diff-547f5794a63e9f138c33b20de8649b7eR20-R31 Not sure why that was originally the case, but we've made the decision that ApplicationExceptions shouldn't be logged by default as they should occur semi-regularly in a healthy application (mostly as an expression of complex logical validation that triggers them based on bad user input): #4569 (comment) Fixes #5253.
SystemExceptions are already logged when the System ServiceProvider listens to the Message Logged event, this code used to be for ApplicationExceptions to bypass the fact that they were explicitly ignored by October's core exception handler. ApplicationExceptions were added 27 Jan 2015 in octobercms/library@6a68036 ApplicationExceptions were explicitly ignored in the core exception handler on 16 Feb 2015 in octobercms/library@237d97d#diff-b6bf0348130fdd1311473a97536310cdR20 and were explicitly logged in the System exception handler on the same day in octobercms/october@7b52e07#diff-547f5794a63e9f138c33b20de8649b7eR20-R31 Not sure why that was originally the case, but we've made the decision that ApplicationExceptions shouldn't be logged by default as they should occur semi-regularly in a healthy application (mostly as an expression of complex logical validation that triggers them based on bad user input): octobercms/october#4569 (comment) Fixes octobercms/october#5253.
SystemExceptions are already logged when the System ServiceProvider listens to the Message Logged event, this code used to be for ApplicationExceptions to bypass the fact that they were explicitly ignored by October's core exception handler. ApplicationExceptions were added 27 Jan 2015 in octobercms/library@6a68036 ApplicationExceptions were explicitly ignored in the core exception handler on 16 Feb 2015 in octobercms/library@237d97d#diff-b6bf0348130fdd1311473a97536310cdR20 and were explicitly logged in the System exception handler on the same day in octobercms/october@7b52e07#diff-547f5794a63e9f138c33b20de8649b7eR20-R31 Not sure why that was originally the case, but we've made the decision that ApplicationExceptions shouldn't be logged by default as they should occur semi-regularly in a healthy application (mostly as an expression of complex logical validation that triggers them based on bad user input): octobercms/october#4569 (comment) Fixes octobercms/october#5253.
This fix resolves #4568 .
Even though logging is suppressed by this dontReport list,
ApplicationException
is logged by ErrorHandler.ErrorHandler::beforeHandleError
is the one that loggingApplicationException
.It is called by
ErrorHandler::handleException
, which is called in the listener ofexception.beforeRender
event registered by ServiceProvider::registerErrorHandler