sails-hook-requestlogger
v1.0.0
Published
Sails JS hook to activate morgan request logging for every request
Downloads
80
Maintainers
Readme
sails-hook-requestlogger
Note: Requires Sails.js version >=0.11.0-rc
Sails JS hook to activate morgan request logging for yoursails app.
Installation
npm install sails-hook-requestLogger
Usage
Just lift your app as normal and all your server requests will be logged, with useful information such as response-time, straight to your console. As a default it is activated in your dev environment but deactivated in production.
Configuration
By default, configuration lives in sails.config.requestlogger
.
Parameter | Type | Details
-------------- | ------------------- |:---------------------------------
format | ((string)) | Defines which logging format to use. Deaults to dev
.
inDevelopment | ((boolean)) | Whether or not to log requests in development environment. Defaults to true
.
inProduction | ((boolean)) | Whether or not to log requests in production environment Defaults to false
.
That’s it!