Reputation:
Is there a configuration parameter for Node JS bunyan where each log can include the corresponding line number, method and class respectively.
Upvotes: 0
Views: 726
Reputation: 181
Using {src:true} option would let node trace the complete path of the file the log has come from leading to do expensive task. You can implement your own class for that and initiate it in every module of the app. Refer to this issue answered by me to make things clear github issue
You can modify things accordingly to add the other info that you want.
Upvotes: 0
Reputation: 193
When you initialize bunyan you can use src: true
bunyan.createLogger({src: true})
It will add the source file, line and function to the log records
https://www.npmjs.com/package/bunyan#src
Upvotes: 1