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
Adding those lines makes app hide unhandled rejections. App just exits nothing related is shown in console:
// index.jsimportwinstonfrom'winston';constlogger=winston.createLogger();thrownewError('this error not shown');
Expected Behavior
...
{"v":0,"level":30,"name":"newrelic","hostname":"MacBook-Pro-Alex.local","pid":54444,"time":"2024-02-09T16:12:19.342Z","msg":"Using New Relic for Node.js. Agent version: 11.10.3; Node version: v20.11.0."}
{"v":0,"level":40,"name":"newrelic","hostname":"MacBook-Pro-Alex.local","pid":54444,"time":"2024-02-09T16:12:19.342Z","msg":"New Relic for Node.js in worker_threads is not officially supported. Not starting! To bypass this, set `config.worker_threads.enabled` to true in configuration."}
file:///Users/baderfall/Documents/web/testing/nr-winston-demo/index.js:5
throw new Error('this error not shown');
^
Error: this error not shown
at file:///Users/baderfall/Documents/web/testing/nr-winston-demo/index.js:5:7
at ModuleJob.run (node:internal/modules/esm/module_job:218:25)
at async ModuleLoader.import (node:internal/modules/esm/loader:329:24)
at async loadESM (node:internal/process/esm_loader:28:7)
at async handleMainPromise (node:internal/modules/run_main:113:12)
Node.js v20.11.0
@alexey-yarmosh sorry the troubles. I was able to trace it down. Our instrumentation sets handleExceptions to true which means these get forwarded to new relic logs feature.
This is behaving as designed. Are you asking to actually see these and not have winston log and forward these to New Relic logs?
Indeed error is shown in New Relic logs. But all other logs are shown both there and in stdout. So to me, expected behaviour would be to see unhandled exception in stdout as well.
Description
Adding those lines makes app hide unhandled rejections. App just exits nothing related is shown in console:
Expected Behavior
Troubleshooting or NR Diag results
Steps to Reproduce
https://github.com/alexey-yarmosh/nr-winston-demo
Your Environment
Node version: v20.11.0
Operating System and version: MacOS 14.3
Additional context
The text was updated successfully, but these errors were encountered: