Azure Functions Java: Duplicate log entries in Portal Log Stream since agent 3.7.0
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 48/100
- Issue type
- Bug
- Clarity
- Mostly clear
- Activity status
- Quiet
- Tech stack
- azure, java
- Domain
- observability
Research direction
Review the agent 3.7.0 dependency change in PR #3962 and compare OpenTelemetry Instrumentation 2.9.0 with 2.10.0, focusing on JUL handling and the Portal Log Stream path. Reproduce with APPLICATIONINSIGHTS_ENABLE_AGENT=true and context.getLogger().info(), then compare behavior with agent 3.6.2. Done means the log appears once in App Insights traces without an [undefined] duplicate in Portal Log Stream.
Written by the indexing model from the issue text.
Description
Description
When APPLICATIONINSIGHTS_ENABLE_AGENT=true (the default), calls to context.getLogger().info() produce duplicate entries in the Azure Portal Log Stream:
[Information]from the host RPC log pipeline[undefined]from the AI agent's JUL auto-instrumentation
The duplication only appears in the Portal Log Stream. In the App Insights traces table, the user log message appears once (from the agent only). The entries stored in App Insights are identical in structure between the working and broken agent versions.
Regression
Introduced in agent 3.7.0, which upgraded OpenTelemetry Java Instrumentation from 2.9.0 to 2.10.0 (PR #3962). No AI agent code changes were made between 3.6.2 and 3.7.0 regarding JUL handling. The behavioral change comes from the upstream OTel dependency bump.
With 3.6.2, the agent captures JUL logs and sends them to App Insights without producing a duplicate in the log stream. Starting with 3.7.0, the same capture also produces an [undefined] entry in the log stream.
| Agent | OTel Instrumentation | User log in AI traces | Duplicate in Log Stream |
|---|---|---|---|
| 3.6.2 | 2.9.0 | Yes | No |
| 3.7.0+ | 2.10.0+ | Yes | Yes |
Affects all Java versions (8, 11, 17, 21, 25) on Linux Dedicated.
Workarounds
| Workaround | Tradeoff |
|---|---|
APPLICATIONINSIGHTS_INSTRUMENTATION_LOGGING_ENABLED=false |
Eliminates duplication but user logs from context.getLogger() no longer appear in App Insights traces |
APPLICATIONINSIGHTS_ENABLE_AGENT=false |
Eliminates duplication but disables all AI agent functionality |
Downgrade to agent 3.6.2 via languageWorkers__java__arguments |
Not viable for managed identity users (azure-functions-java-worker#820) |
No workaround fully restores the 3.6.2 behavior (user logs in AI traces without log stream duplication).
Expected behavior
The agent should capture JUL logs for App Insights without producing a duplicate [undefined] entry in the log stream, as it did in 3.6.2.
- Dominant language
- Java
- Stars
- 327
- Forks
- 222
- Avg merge
- 22h 34m
- Merged PRs (30d)
- 14
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from microsoft/ApplicationInsights-Java
-
microsoft/ApplicationInsights-Java#4851 · 1 assignee ·
-
Difficulty 4/5 3-5 days Newbie friendliness 45/100
microsoft/ApplicationInsights-Java#4817 · 1 comment ·
-
Difficulty 4/5 3-5 days Newbie friendliness 42/100
microsoft/ApplicationInsights-Java#4770 · 2 comments ·
-
Difficulty 5/5 Over a week Newbie friendliness 30/100
microsoft/ApplicationInsights-Java#4769 · 2 comments ·
-
Difficulty 4/5 3-5 days Newbie friendliness 35/100
microsoft/ApplicationInsights-Java#4729 · 121 comments ·
All issues in microsoft/ApplicationInsights-Java
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
elastic/gradle-plugins#157 ·
-
enhancement Tools
Difficulty 1/5 Under an hour Newbie friendliness 75/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
apache/rocketmq-dashboard#5008 ·
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
-
DETECT_PARAMETER_NAMES=false silently disables @ConstructorProperties-based Creator detection too Open
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
FasterXML/jackson-databind#6229 ·