Logging in production environment

45 views
Skip to first unread message

Melvin George

unread,
Feb 15, 2015, 9:18:02 AM2/15/15
to sai...@googlegroups.com
We need some help, guys. Put it simple, 'we need logging in production environment'. The workaround would be to make our production servers run in dev environment. But, before we fix on that workaround...

1) Why was logging disabled completely in prod env? I'm wondering whether it is an industry standard or was it done to optimize for speed.
2) Is there anyway to enable logging in prod env? We rely on the logs to find errors that pop up in real-world usage. We did come across such scenarios where the production logs helped us identify a bug in the code that occurred to users in a specific timezone and nowhere else. And later we found that there was one more bug that was timezone-independent but related to the same api. And these are cases where it was the user who, for his/her convenience, did something in the client side that we developers never do in test devices. We believe that 'there are no dumb users, but only dumb products.'; so rather than calling the common user as 'dumb' to have set his/her device in the wrong (but convenient) way, we'd look at the production logs and see if we can make things better for them no matter how they configure their device.
3) Can more environments other than prod and dev be added? We have unit testing, staging, functional testing scenarios also.
4) What are the differences between prod and dev environments in sailsjs?

We used to code in baremetal nodejs for nearly a year. Baremetal as in 'nodejs and its packages' and nothing more for the server application. We moved into sailsjs to see if it could speed up the coding phase (not just the dev, but also the testing, deployment, integration to metrics, profiling) thereby providing us more time to concentrate on other things that matter to a startup. Using sails, obviously the dev of new api's and code is way faster. But, lack of logging in prod env, lack of custom environments, lack of documentation seems to make us spend the same amount of time in the coding phase as we did when we were coding in pure nodejs environment. I suppose this would be a topic for another discussion, one that is fruitful enough to make things better for everyone. I am sure we can contribute to atleast the documentation of sailsjs even though it has not been more than 2 weeks for us, but it seems impossible for now, because we are still struggling to make sailsjs give us the same amount of visibility into real-world usage of our app which we were able to achieve in baremetal nodejs.

Melvin George

unread,
Feb 16, 2015, 6:11:16 AM2/16/15
to sai...@googlegroups.com
Found the answer to (2) in the questions.
config/env/production.js
  - default log level is 'silent'
  - put it to 'info' for my purposes

That's one silly thing to waste more than a day for :)
Hope everyone else took only 10 seconds for it.
Reply all
Reply to author
Forward
0 new messages