Hello Luke Yen,
Welcome to the Microsoft Q&A and thank you for posting your questions here.
I understand that you are having challenges transferring FunctionAppLogs to Datadog, and you need how to solve the JSON log content that has been escaped.
- To prevent the escaping of logs in your Azure Function App, you can adjust the settings in the
host.json
file by modify it and configure it to handle logs properly without escaping characters. For an example:{ "version": "2.0", "logging": { "applicationInsights": { "samplingSettings": { "isEnabled": false } }, "logLevel": { "Function": "Information", "default": "Information" } } }
- Also, instead of relying on the default logging mechanism, you can implement a custom logger that formats the logs correctly before they are sent to Datadog.
- About Datadog, direct integration with Azure Functions can help in bypassing the additional Azure metadata that gets added to the logs. https://learn.microsoft.com/en-us/azure/azure-functions/configure-monitoring https://learn.microsoft.com/en-us/azure/azure-functions/functions-monitoring
- Also, adjust the serialization settings in the Event Hub configuration to maintain the original log structure.
I hope this is helpful! Do not hesitate to let me know if you have any other questions.
** Please don't forget to close up the thread here by upvoting and accept it as an answer if it is helpful ** so that others in the community facing similar issues can easily find the solution.
Best Regards,
Sina Salam