2017-05-17 1 views
0

私のnodejsexpressプロジェクトで、私はエラーで電子メールを設定しようとしています。 winston & winston-mail PKGS私は次のエラーを取得する nodejs:ウィンストンメールトランスポートスローuncaughtException

を使用して:

{ 
    "date": "Wed May 17 2017 12:36:54 GMT+0530 (IST)", 
    "process": { "pid": 22443, "uid": 502, "gid": 20, "cwd": "/Users/shezad/workspace/goblin", "execPath": "/usr/local/Cellar/node/7.8.0/bin/node", "version": "v7.8.0", "argv": ["/usr/local/Cellar/node/7.8.0/bin/node", "/Users/shezad/workspace/goblin/server.js"], "memoryUsage": { "rss": 52514816, "heapTotal": 37646336, "heapUsed": 24661328, "external": 698215 } }, 
    "os": { "loadavg": [1.8125, 1.763671875, 1.7275390625], "uptime": 1126961 }, 
    "trace": [{ 
     "column": 13, 
     "file": "/Users/shezad/workspace/goblin/node_modules/emailjs/smtp/error.js", 
     "function": "module.exports", 
     "line": 3, 
     "method": "exports", 
     "native": false 
    }, { 
     "column": 29, 
     "file": "/Users/shezad/workspace/goblin/node_modules/emailjs/smtp/response.js", 
     "function": "TLSSocket.error", 
     "line": 26, 
     "method": "error", 
     "native": false 
    }, { 
     "column": 20, 
     "file": "events.js", 
     "function": "emitOne", 
     "line": 101, 
     "method": null, 
     "native": false 
    }, { 
     "column": 7, 
     "file": "events.js", 
     "function": "TLSSocket.emit", 
     "line": 191, 
     "method": "emit", 
     "native": false 
    }, { 
     "column": 8, 
     "file": "net.js", 
     "function": "emitErrorNT", 
     "line": 1284, 
     "method": null, 
     "native": false 
    }, { 
     "column": 11, 
     "file": "internal/process/next_tick.js", 
     "function": "_combinedTickCallback", 
     "line": 80, 
     "method": null, 
     "native": false 
    }, { 
     "column": 9, 
     "file": "internal/process/next_tick.js", 
     "function": "process._tickCallback", 
     "line": 104, 
     "method": "_tickCallback", 
     "native": false 
    }], 
    "stack": ["Error: connection encountered an error", 
     " at module.exports (/Users/shezad/workspace/goblin/node_modules/emailjs/smtp/error.js:3:13)", 
     " at TLSSocket.error (/Users/shezad/workspace/goblin/node_modules/emailjs/smtp/response.js:26:29)", 
     " at emitOne (events.js:101:20)", 
     " at TLSSocket.emit (events.js:191:7)", 
     " at emitErrorNT (net.js:1284:8)", 
     " at _combinedTickCallback (internal/process/next_tick.js:80:11)", 
     " at process._tickCallback (internal/process/next_tick.js:104:9)" 
    ], 
    "level": "error", 
    "message": "uncaughtException: connection encountered an error", 
    "timestamp": "2017-05-17T07:06:54.696Z" 
} 

ロギングは、そのような

config.logging = { 
    file_options: { 
     name: 'app-log', 
     filename: './logs/app.log', 
     level: 'info', 
     timestamp: true, 
     colorize: true, 
     handleExceptions: true, 
     humanReadableUnhandledException: true, 
     prettyPrint: true, 
     json: true, 
     maxsize: 512 * 1024 
    }, 
    mail_options: { 
     to: ['[email protected]'], 
     from: '***@blackbuck.com', 
     subject: format('[{0}]', config.stage_name.toUpperCase()) + ' {{level}} : {{msg}}', 
     host: 'smtp.gmail.com', 
     port: 587, 
     username: '***@blackbuck.com', 
     password: '******', 
     ssl: true, 
     prettyPrint: true, 
    } 
}; 

としてあるため

var logger = new(winston.Logger)({ 

    transports: [ 
     new(winston.transports.Console)({colorize:true}), 
     new(winston.transports.File)(config.logging.file_options), 
     new(winston.transports.Mail)(config.logging.mail_options) 
    ], 
    exceptionHandlers: [ 
     new (winston.transports.Mail)(config.logging.mail_options) 
    ] 
}); 

設定に従うように私のlogger.jsファイルがあります誰かが何を説明できますか?このエラーは?どのようにそれを修正するには?私はそれがうまく取得に管理

答えて

0

、私はまだ、なぜ知らないport: 587

の構成を除去することにより、広告で おかげ? :|