Advertisement
Guest User

sails I hate you

a guest
Dec 15th, 2014
334
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. /**
  2.  * Logger configuration
  3.  *
  4.  * Configure the log level for your app, as well as the transport
  5.  * (Underneath the covers, Sails uses Winston for logging, which
  6.  * allows for some pretty neat custom transports/adapters for log messages)
  7.  *
  8.  * For more information on the Sails logger, check out:
  9.  * http://sailsjs.org/#documentation
  10.  */
  11. var winston = require('winston');
  12. require('winston-mongodb').MongoDB;
  13.  
  14. var customLogger = new winston.Logger({
  15.        
  16. });
  17.  
  18. mongoOptions = {
  19.   db: 'mobile-gift-card'
  20. }
  21. customLogger.add(winston.transports.MongoDB, mongoOptions);
  22.  
  23.  
  24. module.exports = {
  25.   // Valid `level` configs:
  26.   // i.e. the minimum log level to capture with sails.log.*()
  27.   //
  28.   // 'error'    : Display calls to `.error()`
  29.   // 'warn' : Display calls from `.error()` to `.warn()`
  30.   // 'debug'    : Display calls from `.error()`, `.warn()` to `.debug()`
  31.   // 'info' : Display calls from `.error()`, `.warn()`, `.debug()` to `.info()`
  32.   // 'verbose': Display calls from `.error()`, `.warn()`, `.debug()`, `.info()` to `.verbose()`
  33.   //
  34.  
  35.   notify:function() {
  36.    
  37.     console.log('logging enabled')
  38.     Sails.log('info', 'logging enabled')
  39.   },
  40.   log: {
  41.     level: 'info',
  42.     filePath: 'application.log',
  43.     custom: customLogger
  44.   }
  45.  
  46. };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement