Writing Log Trace to external source like Splunk from Azure functions. RRS feed

  • Question

  • Hi All,

    I have a requirement to write the log from Azure functions. I have googled it but could not find any posts.

    As is it even possible to do so?



    Monday, November 27, 2017 6:24 AM


  • Unfortunately this isn't very easy to do right now. The main issue is that azure functions does not expose a convenient hook point to inject your own logger that can send data to splunk. A couple of workarounds come to mind, but they all have drawbacks:

    1. You could reference and use the splunk SDK directly from your function app and do all your logging through that, but this would only capture the log messages you write - any data generated by functions itself would not be captured. Obviously this is not ideal.

    2. You could turn on Application Insights and try to take advantage of their continuous export feature - this writes the logs to a storage account and then you could find some way to ingest that into Splunk. This approach feels convoluted and it would not surprise me if it turns out to be expensive if your system is going to run at high throughput.

    • Marked as answer by Laxmikanth D Tuesday, November 28, 2017 11:51 PM
    Tuesday, November 28, 2017 9:39 PM