I'd be interested in adding logging to my Node.js API as it is becoming more and more complex over time and it looks like I will be asked to continue adding new features to it.I've been doing some research and I've seen that Winston is a popular option, however, I am not quite sure when to log things? Should I just throw some random logging lines here and there where I feel like I'd need them? Or is there a way to structure this in a less arbitrary way?Also, how descriptive should my log messages be? I know this last one is subjective and depends on the case, but if you have any suggestions I would highly appreciate it.And as a last question, how do you manage your logs? Do you store them in a centralized system like Cloudwatch? Do you keep them forever or delete them after a while? How often do you create a new log file?Thanks a lot to anyone willing to help!
Submitted August 20, 2020 at 05:26AM by iwanttobemayor
No comments:
Post a Comment