Add an option to change default action error logging #1561
Replies: 2 comments 4 replies
-
This is a cool idea! Rather than thinking about which actions should log their stack traces, I wonder if it's contextual. You might be throwing errors in your Action which don't indicate an exception with the application, but something that the user is doing is incorrect, ie However, in the same action, what if an error like With that in mind, perhaps the thing to do here is not to modify the logging behavior per Action, but per Error. A few ideas:
Any other ideas? |
Beta Was this translation helpful? Give feedback.
-
Just for clarity, here's the type of error I think you are talking about @greenzelenetskyi
|
Beta Was this translation helpful? Give feedback.
-
I have a suggestion to add an option to configure or maybe override the action error logging logic, as the log messages after errors seem to be too verbose and unnecessary in some cases. For example, it may be unnecessary to log stack trace of a custom app error, which is a part of the app logic, and log it with the same severity level as other errors. So I suggest giving some more control over error logging by adding some error filtering function, which can be overridden, and adding an action error level flag (something like logLevel for common action logging), to use in logAndReportAction (https://github.com/actionhero/actionhero/blob/master/src/classes/actionProcessor.ts#L110), for instance.
Beta Was this translation helpful? Give feedback.
All reactions