I have deployed a node.js application to node.js but not able to see the complete console.log statements from my app. I am using:
heroku logs
Some of the logging is shown but looks like it is not the complete logs. Is there a node.js package to send emails from the deployed app? Email works fine from my localmachine btw.
Email code:
console.log('try to send email hold on');
var nodemailer = require("nodemailer");
var smtpTransport = nodemailer.createTransport({
service: "Gmail",
auth: {
user: "[email protected]",
pass: "mypw"
}
});
smtpTransport.sendMail({
from: "Dikkebil", // sender address
to: "[email protected]", // comma separated list of receivers
subject: "Error body", // Subject line
text: 'Error body: ' +error.body+ '\n'+ 'error type:' + error.type +'\n' +'error statuscode:' +error.statusCode +'\n' + 'error args:' + error.arguments[0]
}, function(error, response){
if(error){
console.log(error);
}else{
console.log("Message sent: " + response.message);
}
});
From the heroku doc:
The logs command retrieves 100 log lines by default. You can specify the number of log lines to retrieve (up to a maximum of 1,500 lines) by using the --num (or -n) option.
$ heroku logs -n 200
So probably you need to request more lines with -n
option.
As per comment received, you can also stream the current log with:
$ heroku logs --tail
Please look at the doc