NodeJS: context.log Not logging Anywhere
See original GitHub issueThis appears to sporadically work, but most of the time it does not.
Repro steps
- Configure a new Azure Functions app to continuously deploy from the following repository: https://github.com/securityvoid/azure-bug.git
NOTE: If you take a look at the code, it is very, very simple. It writes “Boogie” to the context.log and then returns a 200 response:
'use strict';
module.exports = function(context){
context.log("Boogie");
context.res = {
status: 200,
headers: {
"Content-Type" : "application/json"
},
body : { "status" : "alive"}
}
context.done();
}
- Navigate to the URL for the function. e.g. http://azure-bug.azurewebsites.net/api/1.0/test
NOTE: You will receive a message:
{ "status" : "alive"}
- Turn on Application logging within the console: Settings -> Diagnostic Logs -> Application Logging (FileSystem)
NOTE: If you want to, turn on the web server logs, error tracing, etc for good measure.
-
Navigate to the URL another 3-4 times.
-
Within the SCM console go to: D:\home\logfiles\Application\
Browse to your hearts content and try to find “Boogie” anywhere in any of the logs.
Expected behavior
context.log writes to the logs.
It would also be nice if the documentation clearly indicated what needed to be turned on for this to work, if it did work at all.
Actual behavior
Nothing gets logged at all. Every 100-200 times it seems like logging will miraculously turn on for a little bit and it will log, and then it will go back to no mans land.
Known workarounds
None available.
Issue Analytics
- State:
- Created 7 years ago
- Comments:11 (4 by maintainers)
Top GitHub Comments
This does not seem to be solved. I cannot, for the life of me, see anything sent to stdout either sing
context.log
orconsole.log
. It is such a pity. I am on Consumption Plan and I am sure I saw it working in the Standard Plan. I don’t know/don’t want to know what is the difference there just reporting the info.I think this issue should be reopened.
Where are the stdout and stderr rerouted to in a nodejs function app? And console tab is giving the errors as the following
So I don’t know what this is supposed to be used for either