Skip to content
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

Verbose logging does not work #331

Closed
andy-j opened this issue Jul 5, 2017 · 0 comments
Closed

Verbose logging does not work #331

andy-j opened this issue Jul 5, 2017 · 0 comments

Comments

@andy-j
Copy link

andy-j commented Jul 5, 2017

When passed the verbose: true option, rollbar.js does not log errors to the console.

In queue.js:221, the message to log is built using the following:

message = message || _.get(item, 'data.body.trace_chain.0.exception.message');

Digging in to this, item does not have a data property (item.body does exist, however), so this ends up being undefined and nothing is logged. The passing tests do not seem to reflect the actual objects being passed to this function.

Once this is corrected, all that is logged to the console is the error message, with no trace information. With node-rollbar, we got logs like this:

Rollbar:error Handling uncaught exception. +0ms
  Rollbar:error TypeError: Cannot read property 'work' of null
    at Object.<anonymous> (/Users/andy/XXXX/src/XXXX.ts:58:2)
    at Module._compile (module.js:541:32)
    at Module.m._compile (/Users/andy/XXXX/node_modules/ts-node/src/index.ts:413:23)
    at Module._extensions..js (module.js:550:10)
    at Object.require.extensions.(anonymous function) [as .ts] (/Users/andy/XXXX/node_modules/ts-node/src/index.ts:416:12)
    at Module.load (module.js:456:32)
    at tryModuleLoad (module.js:415:12)
    at Function.Module._load (module.js:407:3)
    at Function.Module.runMain (module.js:575:10)
    at Object.<anonymous> (/Users/andy/XXXX/node_modules/ts-node/src/_bin.ts:182:12)
    at Module._compile (module.js:541:32)
    at Object.Module._extensions..js (module.js:550:10)
    at Module.load (module.js:456:32)
    at tryModuleLoad (module.js:415:12)
    at Function.Module._load (module.js:407:3)
    at Function.Module.runMain (module.js:575:10) +1ms

which we would like to preserve after upgrading.

@rokob rokob closed this as completed in 3fb126e Jul 11, 2017
rokob added a commit that referenced this issue Jul 11, 2017
Fix #331 Verbose logging was using the wrong key structure
mudetroit pushed a commit that referenced this issue Mar 14, 2024
The queue gets the item to log that represents the data in the final payload structure of
```
{
  "access_token": "abc123",
  "data": { ... }
}
```

rather than the whole payload itself. The API object is responsible for wrapping that data object up
inside a structure like the above and then sending it. Thus the body of the item is a top level key
rather than nested under the data key.

Secondly, everyone wants the original error to be output if there is one isntead of just the
exception message, so make it so.
mudetroit pushed a commit that referenced this issue Mar 14, 2024
Fix #331 Verbose logging was using the wrong key structure
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant