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

View filename and linenumber #553

Closed
nexflo opened this issue Feb 16, 2015 · 3 comments
Closed

View filename and linenumber #553

nexflo opened this issue Feb 16, 2015 · 3 comments

Comments

@nexflo
Copy link

nexflo commented Feb 16, 2015

Been looking around the web but there doesn't seem to be an easy way to get the linenumber and file where the trace originated from.

For debugging/logging this is nearly elementary.
I do know that there might be a performance impact.

Is this implemented?or is there an easy way to do this? Seems like a default feature not covered in the docs.

Thanks in advance.

@joseph-norman
Copy link

+1 this, would be good with the caveat of performance. Looking at the File transport there isn't an option you can set to count line number or the file, so it isn't implemented by the looks of things.

@callbacknull
Copy link
Contributor

-1 This doesn't seem necessary - also it sort of seems edge case. I don't see my self ever wanting a feature like this except only when it's an error log, which in that case you have the stacktrace already. Plus I setup my logs so that I know exactly what part of my code base it's in just from the printed message.

But if you're looking for file names and stack traces of logs pretaining to something other than an error:
http://stackoverflow.com/questions/11386492/accessing-line-number-in-v8-javascript-chrome-node-js

You can pass __trace as metadata and use a custom formatter.

@indexzero
Copy link
Member

This is a duplicate of #200.

@winstonjs winstonjs locked and limited conversation to collaborators Apr 21, 2015
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants