-
Notifications
You must be signed in to change notification settings - Fork 441
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Function execution logs are duplicated in App Service log stream #1431
Comments
This is highly confusing and just cost me a few hours of searching for the reason. It should be fixed or one need to somehow be warned. |
This is an issue that cost a considerable amount of time. Since this issue has been open for 3 years are there any plans to address this? |
I am experiencing an issue where the invocation of an http triggered function app from a logic app is happening twice, I checked the invocation logs and app insights and did indeed see two calls being made. The logic app is showing one call being made but the function app is being called twice. I am using version 2 (2.0.12961.0) of the functions sdk. |
This issue was opened in 2017 and I am writing this in 2020... :) I am using Azure Function V3 and issue is still exists |
I think there are two different things being discussed here. The behavior that @njabulomp mentioned is about a function actually running twice. That is not what this issue is about. This issue is about the fact that the streaming logs UX for an entire webapp/functionapp subscribes to all file log changes that happen within the D:\home\LogFiles folder. If the same log entry is written to two different files, then this consolidated view will show the entry twice. Since this issue is filed against the functions host, the change that makes the most sense would be for the host level log not include any log entries that will appear in the per-function logs. However I am not sure whether that would break some existing workflows? |
No, the only file logging knob is "fileLoggingEnabled". The issue is that the Log Streaming view is rooted on the parent directory (getting both host/function logs), while the function Logs view is rooted on the individual function directory: The log files/data are correct. I think we just need to change the Log Streaming view to root on the host log dir, which should include everything you'd want to see. |
That might work. I'm asking someone from the portal team. |
We think Mathew's suggested approach makes sense. I should have another update in a few weeks. While the work is happening in a different component, I'll leave this issue open for the time being. |
3+ years later ... any fix for this? I'm seeing this behavior as well. |
@pcgeek86 Can you let us know if you're still having a problem with this? We recently deployed some of the changes that were discussed above. |
I'm not sure if this is related, but I see double logging in application insights on the function logs
customdimensions of item 1
Customdimensions of item 2
|
You should not be adding ApplicationInsights yourself -- the functions host takes care of that. https://docs.microsoft.com/en-us/azure/azure-functions/functions-dotnet-dependency-injection#logging-services |
I sure wish the team would fix this. It doesn't happen locally so the "fidelity" is off for testing between local and Azure function. |
@yobyot Can you clarify what you mean? Are you still seeing duplicate log messages in the log stream view for the full function app? We deployed a fix for this a while ago. If you can include a screenshot that would be helpful. |
@paulbatum I am seeing dup log entries on Azure functions, log below from today. All I am doing is calling context.log from my node.js app:
It's taken considerable time to reassure myself that my functions are not being invoked twice every time, but note that the timestamps are identical in the repeated sections. Does that help at all? Nick |
Not really, the question I asked was what view people are seeing this in. This issue is specifically about the behavior of the full streaming logs view in the azure portal when scoped to the application level. If you are seeing duplicate logs in a different context, for example if there are duplicates in appinsights, then its a different problem and you should file a new issue. |
OK, the log above is the output of |
Huh ok, I suspect az webapp log tail has the same issue that this view in the portal did, i.e. its not using the right directory for functions. I filed: Azure/azure-cli#16921 |
Thanks Paul |
Also I found a workaround - add |
Ah, I see what you did there. Neat! Thank you :) |
Any update on this? I was seeing double logging in "az webapp log tail" output for a function this week. |
Five years later and this is still a nuisance. Any solution in sight? |
i have the same issue that the http trigger func get executed twice,that cause me a lot of problems |
@MatheusNani That's a duplicate execution, not an unexpected duplicate log entry. You may have better luck asking on stackoverflow. |
If you access the log stream for your entire function app, you will see duplicated entries for function starting/completion:
When a function executes with file logging enabled, the following entries are written to both the host log and the function log, i.e. to files in:
D:\home\LogFiles\Application\Functions\Host\
D:\home\LogFiles\Application\Functions\Function\function-name\
The entries look like this:
Because the same entry is written to both locations, it appears in the log stream twice.
The text was updated successfully, but these errors were encountered: