You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We are using this library with nestjs-pino and a graphql api. We have registered a global exception filter that catches all errors in the GQL application and we are logging them usin the pino logger.
None of these exceptions are logged as exceptions (but are logged as traces) because they are missing a property type with the value error. When our errors are sent to pino-applicationinsights its an object that looks like this:
Our logs are missing the item.type property all together. I guess this is because the apollo framework catches the error first and transformans them before we log them. So we dont log actual errors we log object containing the error info.
On the err property I do have the type of the original error but its not Error since we use custom errors.
So my question is. Do the really need the type check to see if we want to treat the item as an exception? Isnt it enough to just check the level and if its level === 50 we log it as an exception to application insights?
馃悰 Bug Report
We are using this library with nestjs-pino and a graphql api. We have registered a global exception filter that catches all errors in the GQL application and we are logging them usin the pino logger.
None of these exceptions are logged as exceptions (but are logged as traces) because they are missing a property
type
with the value error. When our errors are sent to pino-applicationinsights its an object that looks like this:I have found this line to be the reason why our logs are not logged as exceptions:
pino-applicationinsights/src/applicationinsights.js
Line 18 in 122d3bf
Our logs are missing the item.type property all together. I guess this is because the apollo framework catches the error first and transformans them before we log them. So we dont log actual errors we log object containing the error info.
On the
err
property I do have the type of the original error but its notError
since we use custom errors.So my question is. Do the really need the type check to see if we want to treat the item as an exception? Isnt it enough to just check the level and if its level === 50 we log it as an exception to application insights?
Your Environment
pino: 8.10.0
nestjs-pino: 3.1.2
pino-applicationinsights: 2.1.0
pino-http: 8.3.3
The text was updated successfully, but these errors were encountered: