_From @sandersonatlatitude on September 5, 2018 14:55_
In the latest build all console logging of errors is gone, and my queueTrigger do not start .
Using microsoft/azure-functions-node8:2.0
_Copied from original issue: Azure/azure-functions-docker#24_
_From @jmo808 on September 6, 2018 22:6_
The python version has similar issues, I can't get any type of function to work.
@asavaritayal is this still an issue on the latest builds?
I do not see any logs with this build still:
microsoft/azure-functions-python3.6 latest 9f091141a6ab 2 weeks ago 1.24GB
I am setting this env variable in my Dockerfile:
ENV consoleLoggingMode=always
@fabiocav - Is this related to the AZURE_FUNCTIONS_ENVIRONMENT change for console logging? If so, I think we need to add to an environment variable to the base image (Fabio, please correct me especially on the Windows : vs. non-Windows __):
ENV AzureFunctionsJobHost__Logging__Console__IsEnabled=true
cc: @asavaritayal
It's not related to the environment change, but to the logging configuration changes.
In 2.0, we've consolidated all logging configuration into a single model, bringing console logging into that and eliminating the old environment variable we had.
All logging is under the AzureFunctionsJobHost -> Logging section/hierarchy. The environment variable you've shared is correct. For the delimiter, : will work on Windows only, __ works on other platforms.
Thanks @fabiocav :) So current workaround:
add ENV AzureFunctionsJobHost__Logging__Console__IsEnabled=true
@asavaritayal - can you help figure out who can add this to the base image so users don't have to manually configure to get logs?
How can this still be open, absolute joke that you cannot log...
@wpitallo is the recommendation above not working for you?
Hi @fabiocav so I am running a node express server through the portal and I cannot get any console.logs showing at all. The function is working I get results but I cannot get logs working at all. Had a similar issue with logging in the portal in cosmos db (absolutely horrific experience) cant believe that logging is such an issue, it should be straight forward and intuitive, and probably standardized across the platform as far as possible.
@fabiocav I am using 'azure-function-express' also I tried:
app.get("/api/hello-world", (req, res) => {
req.context.log({ hello: "world" });
...
});
Which does not seem to work
@wpitallo just want to make sure I confirm, setting the configuration setting described above (AzureFunctionsJobHost__Logging__Console__IsEnabled) doesn't seem to work for you, is that correct?
@fabiocav I just tried this now and it did work thanks, appreciate the help. I would recommend moving this setting to general settings tho with its own toggle.
Also wanted to ask is it possible to multi line log, change colors etc do you have an api or documentation that you could point me to that could assist with this?
Sorry about the delayed response. I'm glad to hear this worked for you
Changing the logging format is not really an option out of the box. You could add a custom logger using the .NET DI support, but that's not something that is available as a simple configuration setting.
Most helpful comment
Thanks @fabiocav :) So current workaround:
add
ENV AzureFunctionsJobHost__Logging__Console__IsEnabled=true@asavaritayal - can you help figure out who can add this to the base image so users don't have to manually configure to get logs?