0
내 nodejs
express
프로젝트에서 오류가 발생하여 이메일을 설정하려고합니다. winston
& winston-mail
PKGS 나는 다음과 같은 오류가 nodejs : winston 메일 전송 throw 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 파일입니다 누군가 제발 설명해 줄 수 있니? 이 오류는 무엇입니까? 그리고 그것을 어떻게 수정 하는가? 내가이 일을 얻기에 관리