FunctionAppLogs from Diagnostic settings have different format at "properties" field by OS/SKU
See original GitHub issueInvestigative information
Please provide the following:
- Timestamp:
- Function App version: 4.0.1.16815
- Function App name: 2111040060000473ELASTIC-LINUX
- Function name(s) (as appropriate): N/A
- Invocation ID: N/A
- Region: JapanEast
Repro steps
Provide the steps required to reproduce the problem:
- Save FunctionAppLogs to storage account from Diagnostic settings.
Expected behavior
All OS and SKU should have same format.
Actual behavior
■Linux Elastic Premium
“properties” is quoted with "(double quote),
key-values in stringifyed object are quoted with '(single quote)
{ "level": "Informational", "resourceId": "/SUBSCRIPTIONS/---/RESOURCEGROUPS/---/PROVIDERS/MICROSOFT.WEB/SITES/2111040060000473ELASTIC-LINUX", "operationName": "Microsoft.Web/sites/functions/log", "category": "FunctionAppLogs", "time": "11/15/2021 11:36:06", "properties": "{'appName':'2111040060000473elastic-linux','roleInstance':'4de66c2ce3805624b7e310460ca35c2789c27a85279b183e8c95aef70dd8d30a','message':'Starting JobHost','category':'Microsoft.Azure.WebJobs.Hosting.JobHostService','hostVersion':'4.0.1.16815','hostInstanceId':'3d7b63ad-2230-4902-9d52-195b26396d5f','level':'Information','levelId':2,'processId':19}", "EventStampType": "Stamp", "EventPrimaryStampName": "waws-prod-ty1-021", "EventStampName": "waws-prod-ty1-021e", "Host": "RD00155D7B6F5E", "EventIpAddress": "10.0.4.43"}
■Linux Consumption “properties” is not quoted, key-value in object are quoted with '(single quote) Single quotation in json object is invalid
{ "time": "2021-11-15T12:27:30Z", "resourceId": "/SUBSCRIPTIONS/---/RESOURCEGROUPS/---/PROVIDERS/MICROSOFT.WEB/SITES/2111040060000473CONSUMPTION-LINUX", "category": "FunctionAppLogs", "operationName": "Microsoft.Web/sites/functions/log", "level": "Informational", "properties": {'appName':'2111040060000473consumption-linux','roleInstance':'0F4222AC-637725731219525275','message':'Starting JobHost','category':'Microsoft.Azure.WebJobs.Hosting.JobHostService','hostVersion':'4.0.1.16815','hostInstanceId':'cf783750-4b85-42ad-ba30-09b691ad4643','level':'Information','levelId':2,'processId':71}}
■Windows Elastic Premium “properties” is not quoted, key-value in object are quoted with "(double quote) This format is totally valid json
{ "time": "2021-11-15T12:33:42.3447980Z", "resourceId": "/SUBSCRIPTIONS/---/RESOURCEGROUPS/---/PROVIDERS/MICROSOFT.WEB/SITES/2111040060000473ELASTIC-WINDOWS", "category": "FunctionAppLogs", "operationName": "Microsoft.Web/sites/functions/log", "level": "Informational", "location": "Japan East", "properties": {"appName":"2111040060000473elastic-windows","roleInstance":"2b4c36a34f16a3e3e5cff084e931fa6d2824e9831242d56c0be5eb98bc673cba","message":"Starting JobHost","category":"Microsoft.Azure.WebJobs.Hosting.JobHostService","hostVersion":"4.0.1.16815","hostInstanceId":"e36b2a05-2985-427f-8611-6f4aba67a07a","level":"Information","levelId":2,"processId":2552}}
■Windows Consumption “properties” is not quoted, key-value in object are quoted with "(double quote) This format is totally valid json This format is as same as Windows Elastic Premium
{ "time": "2021-11-15T12:30:45.9159658Z", "resourceId": "/SUBSCRIPTIONS/---/RESOURCEGROUPS---/PROVIDERS/MICROSOFT.WEB/SITES/2111040060000473CONSUMPTION-WINDOWS", "category": "FunctionAppLogs", "operationName": "Microsoft.Web/sites/functions/log", "level": "Informational", "location": "Japan East", "properties": {"appName":"2111040060000473consumption-windows","roleInstance":"d476ae96b48fc235309ba1fcc879ec5ce2731f618425933ab7d648744c03d544","message":"Starting JobHost","category":"Microsoft.Azure.WebJobs.Hosting.JobHostService","hostVersion":"4.0.1.16815","hostInstanceId":"6a179724-1237-4598-bc06-d9121dbf40ac","level":"Information","levelId":2,"processId":6796}}
Known workarounds
N/A
Related information
Provide any related information
- Programming language used Node
- Links to source
- Bindings used
Issue Analytics
- State:
- Created 2 years ago
- Reactions:1
- Comments:8 (4 by maintainers)
Top Results From Across the Web
Invalid JSON logs produced for function apps.
The app writes a valid JSON to a console output. I am using diagnostic settings to send Function Application Logs to a Log...
Read more >Can't set Diagnostic Settings on Function App using Azure ...
I have a Bicep module to create a Function app and its Diagnostic Settings, and after a successful deployment, I saw that the...
Read more >Deploy Diagnostic Settings for Azure Function App to Log ...
Deploy Diagnostic Settings for Azure Function App to Log Analytics workspace ; Mode, Indexed ; Type, Custom Azure Landing Zones (ALZ) ; Preview ......
Read more >Diagnostic Data: Microsoft Azure Resource Manager (ARM)
The Azure Diagnostic Data integration allows processing of logs and metrics submitted to an Event Hub using the resource diagnostic settings ...
Read more >mod 5 ch 16 Flashcards by Kyle Herzberg
Study mod 5 ch 16 flashcards from Kyle Herzberg's class online, or in Brainscape's iPhone or Android app. ✓ Learn faster with spaced...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Thanks for reporting the issue. Tagging @CooperLink for initial investigation.
Thanks for confirming this! Is there an update on the ETA for runtime v5?