Skip to content


Subversion checkout URL

You can clone with
Download ZIP


Issue #1410: Add 'timestamp' option to logger. #1411

merged 1 commit into from

3 participants


Add winston's timestamp option to Sails logger.


how would someone enable this feature? Is there documentation along with this change?


One can enable this by putting the timestamp variable in the log config.

module.exports = {
  log: {
    level: 'info',
    timestamp: true

There's no documentation right now, but I can add it in. I'm not sure where to put it though.


:+1: checkout balderdashy/sails-docs there should be a file there for it.

Heres the file you should update..

@russellsantos russellsantos referenced this pull request from a commit in russellsantos/sails-docs
@russellsantos russellsantos Documentation for balderdashy/sails#1411. Added timestamp config to l…

Added the documentation to the v0.9 branch on sails-docs, as requested.


Hey @russellsantos, thanks! What would this look like for v0.10, in your opinion?


@mikermcneil, it looks like in v0.10, Sails uses Captain's Log, which doesn't use Winston by default.
People can use Winston, by using a custom logger. And they can pass the timestamp option to the logger itself.

So we don't really need to change any code for people to be able to do this in v0.10. They just need to pass a custom Logger in the configuration.


@russellsantos thanks!

@mikermcneil mikermcneil merged commit e4598f1 into balderdashy:v0.9
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Feb 17, 2014
  1. @russellsantos
This page is out of date. Refresh to see the latest.
Showing with 6 additions and 3 deletions.
  1. +6 −3 lib/logger.js
9 lib/logger.js
@@ -31,7 +31,8 @@ module.exports = function(sails) {
maxFiles: 10,
json: false,
colorize: true,
- level: 'info'
+ level: 'info',
+ timestamp: false
var winston = require('winston');
@@ -40,7 +41,8 @@ module.exports = function(sails) {
var transports = [
level: 'debug',
- colorize: config.colorize
+ colorize: config.colorize,
+ timestamp: config.timestamp
@@ -53,7 +55,8 @@ module.exports = function(sails) {
maxFiles: config.maxFiles,
level: 'verbose',
json: config.json,
- colorize: config.colorize
+ colorize: config.colorize,
+ timestamp: config.timestamp
Something went wrong with that request. Please try again.