Not necessarily good to separate stdout from stderr. Sometimes you want to see an error in its context.
Then, if you have 800 requests per second, reading logs in this way will not be very valuable.
Best way I have found to manage logs is:
- give requests a unique id. use that id when logging anything related to that request.
- have logs in unformatted json format for size. e.g: use bunyan to save them, use bunyan-cli or jq to read them.
- use unix tools like grep, sort, uniq, wc, etc. to find things...
- you can also feed your logs to elasticsearch/kibana or another aggregator. e.g: logio.org.
Again, jq is very useful processing json. it can help you query logs and find what you need, and format results in any arbitrary way. Make your logs queryable, don't save formatted logs. you will make your life difficult in this way.
Then, if you have 800 requests per second, reading logs in this way will not be very valuable.
Best way I have found to manage logs is:
- give requests a unique id. use that id when logging anything related to that request.
- have logs in unformatted json format for size. e.g: use bunyan to save them, use bunyan-cli or jq to read them.
- use unix tools like grep, sort, uniq, wc, etc. to find things...
- you can also feed your logs to elasticsearch/kibana or another aggregator. e.g: logio.org.
Again, jq is very useful processing json. it can help you query logs and find what you need, and format results in any arbitrary way. Make your logs queryable, don't save formatted logs. you will make your life difficult in this way.