I have a basic piece of code just to log what's in the session and it's not outputting anything to the Log panel in the Bot Service...
bot.dialog('/', [
function (session) {
console.log(session);
const message = "Hello... What's your name?";
builder.Prompts.text(session, message);
},
]);
console.log('TEST'); doesn't even log anything either. I've tried to enable logging in the Diagnostic Logs section of the Application Settings but I just get an error: "Failed to update web app logs settings"
Any idea what's going on?
@hailiu2586, do you have any suggestions?
Try the following workaround.
In your messages/index.js, wrap the returned function from connector.listen() with console.log override, like below:
```javascript
if (useEmulator) {
var restify = require('restify');
var server = restify.createServer();
server.listen(3978, function() {
console.log('test bot endpont at http://localhost:3978/api/messages');
});
server.post('/api/messages', connector.listen());
} else {
var listener = connector.listen();
var withLogging = function(context, req) {
console.log = context.log;
listener(context, req);
}
module.exports = { default: withLogging }
}
Awesome, that works perfectly!! Thanks @hailiu2586 馃憤
Any help on how to diagnose deployment errors?
I can't see if there are any errors since there is no diagnostics log.
The fix didn't work for me...
Most helpful comment
Try the following workaround.
In your messages/index.js, wrap the returned function from connector.listen() with console.log override, like below:
```javascript
if (useEmulator) {
var restify = require('restify');
var server = restify.createServer();
server.listen(3978, function() {
console.log('test bot endpont at http://localhost:3978/api/messages');
});
server.post('/api/messages', connector.listen());
} else {
var listener = connector.listen();
var withLogging = function(context, req) {
console.log = context.log;
listener(context, req);
}
}