Change logAction logic
See original GitHub issueIs your feature request related to a problem? Please describe.
In our application we use AppError(
as instance of Error
with some additional fields). For send correct error to API users we parse error in config/errors.js
based on type of Error. If AppError
we add correct message and code, as example AppError
: “Transaction already refunded”. And if it is generic Error we return “Internal error”. We start migrate to 22 version. And have some problem. When we throw AppError
in our app it’s logs by Actionhero as Error, and splits stack to different lines, what good for console, but not good to elasticsearch as logs storage(winston-elastic
). Before we resolve this problem by redefine api.log
method but now, with 22 version of Actionhero it’s not possible.
For me this issue contain two problems:
- logging stack trace by separate
log
calls. After search in Actionhero project I find 2 places that have similar logic(actionProcessor, exceptions) - logging our internal AppError with
severity: error
. Best for us, it not logs action error if it matches some pattern. But for Actionhero maybe be simple add possibility to redefine log module
Describe the solution you’d like
- Not log every stack trace line by separate
log
call - Add possibility to redefine
log
function or add some filtration function(or formatting with filtration possibility)
If we reach an agreement how to resolve this in the best way, I can do PR.
Issue Analytics
- State:
- Created 3 years ago
- Comments:5 (5 by maintainers)
Top GitHub Comments
This weekend!
And… it’s deployed 😄 sorry for the late reply!