---
title: Log Azure Logic Apps with an Azure Function, without Diagnostics
description: "Log Azure Logic Apps from the workflow itself: call one shared Azure Function where logging is required, write a Nodinite JSON Log Event to Service Bus, Event Hub or Blob, and let the Pickup Service read it. No diagnostic setting and no REST API reads."
---

# <i class="fal fa-bolt" aria-hidden="true"></i> Log Logic Apps with an Azure Function

When the volume is too high for Diagnostics Logging, or you want full control over what is logged, let the workflow log for itself. One shared Azure Function does the work, and no diagnostic setting or REST API call is involved.

* ✅ No diagnostic setting, no diagnostic Event Hub, no REST API reads, no HTTP 429 from them  
* ✅ [Log Events][Log Event] within seconds, with the names and context you choose  
* ✅ One Function shared by all workflows, so the JSON format lives in one place  
* ✅ For the highest volumes: no workflow at all, Functions and queues  

Diagnostics Logging learns about a run afterwards, from Azure: a diagnostic event through an Event Hub, then the payloads through the Azure REST API (see [Log Logic Apps at Scale][Log Logic Apps at Scale - Two paths]). There is another way that skips both: the workflow logs for itself. Where logging is required, the workflow calls one shared Azure Function with the message and a few context values. The Function builds a <span class="nodinite-product-name" title="The node that unites different systems. Or as we call it Nodinite">Nodinite</span> [JSON Log Event][] and writes it to an intermediate storage, such as a Service Bus queue, an Event Hub or a Blob container, and the [Pickup Log Events Service][Pickup Service] reads it into <span class="nodinite-product-name" title="The node that unites different systems. Or as we call it Nodinite">Nodinite</span>. This is [Custom Logging][], with the Function as the shared building block; see [About Logic Apps Logging options][About Logic Apps Logging options - Custom Logging].

<div class="mermaid">
graph LR
    roRun["fa:fa-sitemap Workflow run"] -->|"at - Logging points"| roFn["fa:fa-bolt Azure Function<br/>builds the JSON Log Event"]
    roFn --> roSink["fa:fa-inbox Service Bus, Event Hub or Blob"]
    roSink --> roPickup["fa:fa-truck-pickup Pickup Service"]
    roPickup --> roApi["fa:fa-cloud-arrow-down Log API"]
    roRun -.->|"not needed"| roDiag["fa:fa-ban Diagnostic setting<br/>and REST API fetches"]
    style roFn fill:#2678BD
    style roSink fill:#93d16d
    style roPickup fill:#93d16d
    style roDiag fill:#d6d6d6
</div>

*The workflow hands the message to the Function (blue), and the Log Event travels through storage you own to <span class="nodinite-product-name" title="The node that unites different systems. Or as we call it Nodinite">Nodinite</span> (green). No diagnostic setting and no REST API reads are involved (grey).*

| | <i class="fal fa-code-branch" aria-hidden="true"></i> Diagnostics Logging | <i class="fal fa-bolt" aria-hidden="true"></i> Logging with an Azure Function |
|---|---|---|
| <i class="fal fa-code" aria-hidden="true"></i> **Workflow change** | ✅ None | ⚠️ A call at every point you log |
| <i class="fal fa-sliders" aria-hidden="true"></i> **Diagnostic setting and Event Hub for diagnostics** | ⚠️ Required | ✅ Not needed |
| <i class="fal fa-cloud" aria-hidden="true"></i> **REST API reads per logged Action** | ⚠️ Yes, and HTTP 429 at volume | ✅ None |
| <i class="fal fa-filter" aria-hidden="true"></i> **What is logged** | What the [Logging filters][Configuration - Logging - Filters] match | Exactly what the workflow sends |
| <i class="fal fa-clock" aria-hidden="true"></i> **Delay** | Minutes: Azure's diagnostic pipeline | Seconds: as fast as the Pickup Service reads |
| <i class="fal fa-tag" aria-hidden="true"></i> **Names and context** | From the workflow, Action and tracked properties | Set by the Function: [Message Type][Message Types], [Endpoint][Endpoints], correlation id |
| <i class="fal fa-coins" aria-hidden="true"></i> **Azure cost** | Event Hub and the run history reads | Function executions, the intermediate storage, and one more Action per logging point |

Keep in mind:

* The workflow passes the message to the Function as an Action input, so the run history still stores it for the retention. Logging from the workflow removes the reads, not the storage; see [Store less in Azure][Log Logic Apps at Scale - Store less].
* Call the Function only where the [naming policy][Log Logic Apps at Scale - Naming] says to log, and keep it fast: the workflow waits for its answer. A queue between the Function and <span class="nodinite-product-name" title="The node that unites different systems. Or as we call it Nodinite">Nodinite</span> absorbs peaks and <span class="nodinite-product-name" title="The node that unites different systems. Or as we call it Nodinite">Nodinite</span> maintenance.
* The [Logic Apps Agent][Azure Logic Apps Agent] can still [monitor][Monitoring Logic Apps] the workflows. Only the logging moves to the Function.
* The same AI change that applies the naming policy can add the Function call at the same points; see [Apply the naming policy with AI][Log Logic Apps at Scale - AI].
* Inside a .NET Function, [Serilog][] with a <span class="nodinite-product-name" title="The node that unites different systems. Or as we call it Nodinite">Nodinite</span> sink writes the JSON Log Event for you.

<h2 id="functions-and-queues"><i class="fal fa-diagram-next" aria-hidden="true"></i> Go further: replace the workflow with Functions and queues</h2>

For the flows with the highest volume, the better design may be no workflow at all. One or more Azure Functions do the work, and they pass the message and its state to each other through queues, such as [Azure Service Bus][Monitoring Azure Service Bus Queue]. Nothing writes a run history, so Azure stores no inputs and outputs per Action, and nothing is left for anyone to read back through the Azure REST API.

<div class="mermaid">
graph LR
    roIn["fa:fa-inbox Queue: received"] --> roF1["fa:fa-bolt Function: validate"]
    roF1 --> roQ1["fa:fa-inbox Queue: validated"]
    roQ1 --> roF2["fa:fa-bolt Function: map and send"]
    roF2 --> roOut["fa:fa-paper-plane Target system"]
    roF1 -.->|"Serilog"| roLog["fa:fa-cloud-arrow-down Log Events to Nodinite"]
    roF2 -.->|"Serilog"| roLog
    style roQ1 fill:#93d16d
    style roIn fill:#93d16d
    style roLog fill:#2678BD
</div>

*Functions chained by queues (green): each queue holds the state between two steps and absorbs peaks. Each Function logs exactly what it needs, through [Serilog][] (blue).*

| | <i class="fal fa-sitemap" aria-hidden="true"></i> Logic Apps workflow | <i class="fal fa-bolt" aria-hidden="true"></i> Functions and queues |
|---|---|---|
| <i class="fal fa-hard-drive" aria-hidden="true"></i> **Stored per run** | Every input and output of every Action, for the retention | Only what is in the queues, until it's read |
| <i class="fal fa-coins" aria-hidden="true"></i> **Billed per** | Action execution (Consumption) or plan (Standard) | Function execution or plan, and queue operations |
| <i class="fal fa-gauge-high" aria-hidden="true"></i> **At high volume** | Run history storage and the Azure REST API set the limits | The queues and the Functions scale out |
| <i class="fal fa-plug" aria-hidden="true"></i> **Connectors and designer** | ✅ Hundreds of connectors, low-code designer | ⚠️ Code: you write the integration |
| <i class="fal fa-magnifying-glass" aria-hidden="true"></i> **Troubleshooting** | Run history in the Azure portal, for people with Azure access; slow at high volume | ✅ <span class="nodinite-product-name" title="The node that unites different systems. Or as we call it Nodinite">Nodinite</span> [Log Views][] with the payloads, [repair and resend][Log Event Details and Repair], and the queues' dead-letter messages, without Azure access |
| <i class="fal fa-file-invoice-dollar" aria-hidden="true"></i> [Cost of logging][Cost of Logging] | Run history retention, and Application Insights or Log Analytics per GB | ✅ [Serilog][] to <span class="nodinite-product-name" title="The node that unites different systems. Or as we call it Nodinite">Nodinite</span>, with retention per [Message Type][Message Types]; see [Reduce Azure Functions Logging Costs][] |
| <i class="fal fa-eye" aria-hidden="true"></i> **Monitoring with <span class="nodinite-product-name" title="The node that unites different systems. Or as we call it Nodinite">Nodinite</span>** | [Logic Apps Agent][Azure Logic Apps Agent] | [Azure Functions][Monitoring Function] and [Service Bus Queues][Monitoring Azure Service Bus Queue] |

Nothing is lost by leaving the run history behind. <span class="nodinite-product-name" title="The node that unites different systems. Or as we call it Nodinite">Nodinite</span> logging and monitoring together do more than the built-in Azure tools, at a lower total cost: see [Reduce Azure Functions Logging Costs][] and [Reduce Azure Logic Apps Run History Retention to Lower TCO][Logic Apps TCO].

Choose it for flows that run often and do simple, well-known work: receive, validate, map, route and send. Keep Logic Apps for flows with low volume that lean on connectors and the designer. Many solutions mix both.

<aside aria-label="Warning" class="nodinite-note nodinite-note--warning">
<p class="nodinite-note__label" aria-hidden="true"><i class="far fa-fw fa-triangle-exclamation"></i> Warning</p>
<div class="nodinite-note__content"><p>Durable Functions keep their orchestration history in a storage account, as a workflow does. At this volume they bring the same storage limit back. Chain plain Functions with queues instead.</p></div>
</aside>

## <i class="fal fa-hand-point-right" aria-hidden="true"></i> Next Steps

* <i class="fal fa-code" aria-hidden="true"></i> [JSON Log Event][]  
* <i class="fal fa-truck-pickup" aria-hidden="true"></i> [Pickup Log Events Service][Pickup Service]  
* <i class="fal fa-gauge-high" aria-hidden="true"></i> [Log Logic Apps at Scale][]  

## <i class="fal fa-link-horizontal" aria-hidden="true"></i> Related Topics

* <i class="fal fa-scale-balanced" aria-hidden="true"></i> [About Logic Apps Logging options][]  
* <i class="fal fa-pen-ruler" aria-hidden="true"></i> [Custom Logging][]  
* <i class="fal fa-bolt" aria-hidden="true"></i> [Serilog][]  

[About Logic Apps Logging options]:https://docs.nodinite.com/logging-and-monitoring/azure-logic-apps/troubleshooting/about-logic-apps-logging-options/
[About Logic Apps Logging options - Custom Logging]:https://docs.nodinite.com/logging-and-monitoring/azure-logic-apps/troubleshooting/about-logic-apps-logging-options/#option-4-nodinite-custom-logging
[Azure Logic Apps Agent]:https://docs.nodinite.com/logging-and-monitoring/azure-logic-apps/overview/
[Configuration - Logging - Filters]:https://docs.nodinite.com/logging-and-monitoring/azure-logic-apps/getting-started/configuration-logging/#fa-filter-understanding-logic-apps-logging-filters
[Cost of Logging]:https://docs.nodinite.com/getting-started/log/logging-strategy/understand-the-cost-of-logging/
[Custom Logging]:https://docs.nodinite.com/logging-and-monitoring/custom-logging/overview/
[Endpoints]:https://docs.nodinite.com/repository-model/endpoints/overview/
[JSON Log Event]:https://docs.nodinite.com/core-services/log-event/features/json-log-event/
[Log Event]:https://docs.nodinite.com/core-services/log-event/overview/
[Log Event Details and Repair]:https://docs.nodinite.com/administration/log-management/log-views/features/view-log-event-details-and-repair/
[Log Logic Apps at Scale]:https://docs.nodinite.com/logging-and-monitoring/azure-logic-apps/troubleshooting/log-logic-apps-at-scale/
[Log Logic Apps at Scale - AI]:https://docs.nodinite.com/logging-and-monitoring/azure-logic-apps/troubleshooting/log-logic-apps-at-scale/#apply-the-naming-policy-with-ai
[Log Logic Apps at Scale - Naming]:https://docs.nodinite.com/logging-and-monitoring/azure-logic-apps/troubleshooting/log-logic-apps-at-scale/#naming
[Log Logic Apps at Scale - Store less]:https://docs.nodinite.com/logging-and-monitoring/azure-logic-apps/troubleshooting/log-logic-apps-at-scale/#store-less
[Log Logic Apps at Scale - Two paths]:https://docs.nodinite.com/logging-and-monitoring/azure-logic-apps/troubleshooting/log-logic-apps-at-scale/#two-paths
[Log Views]:https://docs.nodinite.com/administration/log-management/log-views/features/what-is-a-log-view/
[Logic Apps TCO]:https://docs.nodinite.com/logging-and-monitoring/azure-logic-apps/troubleshooting/reduce-azure-logic-apps-run-history-retention-to-lower-tco/
[Message Types]:https://docs.nodinite.com/repository-model/message-types/overview/
[Monitoring Azure Service Bus Queue]:https://docs.nodinite.com/logging-and-monitoring/message-queueing/features/azure-service-bus-queues/monitoring-azure-service-bus-queue/
[Monitoring Function]:https://docs.nodinite.com/logging-and-monitoring/azure/features/function/monitoring-function/
[Monitoring Logic Apps]:https://docs.nodinite.com/logging-and-monitoring/azure-logic-apps/features/monitoring-logic-apps/
[Pickup Service]:https://docs.nodinite.com/logging-and-monitoring/pickup-logevents-service/overview/
[Reduce Azure Functions Logging Costs]:https://docs.nodinite.com/logging-and-monitoring/serilog/troubleshooting/reduce-azure-functions-logging-costs/
[Serilog]:https://docs.nodinite.com/logging-and-monitoring/serilog/overview/