Could you recommend me a good log4j-like logging system for node.js?
It’s not a log4j port, but Winston offers some similar functionality. https://github.com/indexzero/winston
I think Winston is really good, however since you mentioned log4j you might be interested in the node port: node-log4js
I have looked through many loggers, and I wasn’t able to find a lightweight solution – so I decided to make a simple solution that is posted on github.
- Saves the file
- Gives you a pretty output (we all love that)
- Easy to use
I hope this helps you out.
PS: If there are any problems, I would appreciate it if you can fix it and then do a pull request. Otherwise, you are more than welcome to post as an issue.
You can also try looking at https://www.npmjs.org/package/bunyan
Its output is JSON format and can have different stream for output like stoud, log file along with option to number of files to maintain before rotate/recycle similar to Log4j.
As per the documentation on npm, it is also used by Joyent in the production.