Is it alright to use morgan as logger on production mode, or just throw it away and only use it on development mode?
What's the best practice for logging on production mode?
Logging in production best practice?
5.2k Views Asked by Terry Djony At
1
There are 1 best solutions below
Related Questions in NODE.JS
- Multiple jQuery slideshows won't stay in sync
- backgrounds Slideshow, but text scrolling
- change jquery malsup.cycle2 to multi layer slide show
- Scrolling image slideshow
- How to clear the index of ngrepeat in a modal
- Infinite looped vertical slider with no pause
- iOS: SDWebImageManager not caching image
- Bootstrap Carousel not working correctly
- Flexslider with a popup Gallery
- setTimeout controls
Related Questions in EXPRESS
- Multiple jQuery slideshows won't stay in sync
- backgrounds Slideshow, but text scrolling
- change jquery malsup.cycle2 to multi layer slide show
- Scrolling image slideshow
- How to clear the index of ngrepeat in a modal
- Infinite looped vertical slider with no pause
- iOS: SDWebImageManager not caching image
- Bootstrap Carousel not working correctly
- Flexslider with a popup Gallery
- setTimeout controls
Related Questions in LOGGING
- Multiple jQuery slideshows won't stay in sync
- backgrounds Slideshow, but text scrolling
- change jquery malsup.cycle2 to multi layer slide show
- Scrolling image slideshow
- How to clear the index of ngrepeat in a modal
- Infinite looped vertical slider with no pause
- iOS: SDWebImageManager not caching image
- Bootstrap Carousel not working correctly
- Flexslider with a popup Gallery
- setTimeout controls
Related Questions in MORGAN
- Multiple jQuery slideshows won't stay in sync
- backgrounds Slideshow, but text scrolling
- change jquery malsup.cycle2 to multi layer slide show
- Scrolling image slideshow
- How to clear the index of ngrepeat in a modal
- Infinite looped vertical slider with no pause
- iOS: SDWebImageManager not caching image
- Bootstrap Carousel not working correctly
- Flexslider with a popup Gallery
- setTimeout controls
Trending Questions
- UIImageView Frame Doesn't Reflect Constraints
- Is it possible to use adb commands to click on a view by finding its ID?
- How to create a new web character symbol recognizable by html/javascript?
- Why isn't my CSS3 animation smooth in Google Chrome (but very smooth on other browsers)?
- Heap Gives Page Fault
- Connect ffmpeg to Visual Studio 2008
- Both Object- and ValueAnimator jumps when Duration is set above API LvL 24
- How to avoid default initialization of objects in std::vector?
- second argument of the command line arguments in a format other than char** argv or char* argv[]
- How to improve efficiency of algorithm which generates next lexicographic permutation?
- Navigating to the another actvity app getting crash in android
- How to read the particular message format in android and store in sqlite database?
- Resetting inventory status after order is cancelled
- Efficiently compute powers of X in SSE/AVX
- Insert into an external database using ajax and php : POST 500 (Internal Server Error)
Popular # Hahtags
Popular Questions
- How do I undo the most recent local commits in Git?
- How can I remove a specific item from an array in JavaScript?
- How do I delete a Git branch locally and remotely?
- Find all files containing a specific text (string) on Linux?
- How do I revert a Git repository to a previous commit?
- How do I create an HTML button that acts like a link?
- How do I check out a remote Git branch?
- How do I force "git pull" to overwrite local files?
- How do I list all files of a directory?
- How to check whether a string contains a substring in JavaScript?
- How do I redirect to another webpage?
- How can I iterate over rows in a Pandas DataFrame?
- How do I convert a String to an int in Java?
- Does Python have a string 'contains' substring method?
- How do I check if a string contains a specific word?
Yes! It is all right to use Morgan as a logger on production mode.
Arguably, if I can generalize to answer your question, the best practice in production is to log as many details as possible. The idea is that the logs on your server show you as much relevant information as you need. After all, you and the people with access to the server are the only one who sees them, right?
A strategy I use is a 'combined' mode in production, which is a bit more detailed, and a 'dev' mode in development, which is more concise.
You can switch those easily with environmental variable or whatever. Example:
Another thing I always configure is writing the logs in an external file. Needless to say why this is a nice to have, in production.
That's it in terms of Morgan. If you are wondering about the best for logging in general, well, that's another question which is already answered.