---
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."
---

# :fa-bolt: 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 :Nodinite: [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 :Nodinite:. 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 :Nodinite: (green). No diagnostic setting and no REST API reads are involved (grey).*

| | :fa-code-branch: Diagnostics Logging | :fa-bolt: Logging with an Azure Function |
|---|---|---|
| :fa-code: **Workflow change** | ✅ None | ⚠️ A call at every point you log |
| :fa-sliders: **Diagnostic setting and Event Hub for diagnostics** | ⚠️ Required | ✅ Not needed |
| :fa-cloud: **REST API reads per logged Action** | ⚠️ Yes, and HTTP 429 at volume | ✅ None |
| :fa-filter: **What is logged** | What the [Logging filters][Configuration - Logging - Filters] match | Exactly what the workflow sends |
| :fa-clock: **Delay** | Minutes: Azure's diagnostic pipeline | Seconds: as fast as the Pickup Service reads |
| :fa-tag: **Names and context** | From the workflow, Action and tracked properties | Set by the Function: [Message Type][Message Types], [Endpoint][Endpoints], correlation id |
| :fa-coins: **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 :Nodinite: absorbs peaks and :Nodinite: 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 :Nodinite: sink writes the JSON Log Event for you.

## :fa-diagram-next: Go further: replace the workflow with Functions and queues {#functions-and-queues}

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).*

| | :fa-sitemap: Logic Apps workflow | :fa-bolt: Functions and queues |
|---|---|---|
| :fa-hard-drive: **Stored per run** | Every input and output of every Action, for the retention | Only what is in the queues, until it's read |
| :fa-coins: **Billed per** | Action execution (Consumption) or plan (Standard) | Function execution or plan, and queue operations |
| :fa-gauge-high: **At high volume** | Run history storage and the Azure REST API set the limits | The queues and the Functions scale out |
| :fa-plug: **Connectors and designer** | ✅ Hundreds of connectors, low-code designer | ⚠️ Code: you write the integration |
| :fa-magnifying-glass: **Troubleshooting** | Run history in the Azure portal, for people with Azure access; slow at high volume | ✅ :Nodinite: [Log Views][] with the payloads, [repair and resend][Log Event Details and Repair], and the queues' dead-letter messages, without Azure access |
| :fa-file-invoice-dollar: [Cost of logging][Cost of Logging] | Run history retention, and Application Insights or Log Analytics per GB | ✅ [Serilog][] to :Nodinite:, with retention per [Message Type][Message Types]; see [Reduce Azure Functions Logging Costs][] |
| :fa-eye: **Monitoring with :Nodinite:** | [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. :Nodinite: 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.

>[!WARNING]
>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.

## :fa-hand-point-right: Next Steps

* :fa-code: [JSON Log Event][]  
* :fa-truck-pickup: [Pickup Log Events Service][Pickup Service]  
* :fa-gauge-high: [Log Logic Apps at Scale][]  

## :fa-link-horizontal: Related Topics

* :fa-scale-balanced: [About Logic Apps Logging options][]  
* :fa-pen-ruler: [Custom Logging][]  
* :fa-bolt: [Serilog][]  

[About Logic Apps Logging options]:{ndr}/Logging%20and%20Monitoring/Azure%20Logic%20Apps/Troubleshooting/About%20Logic%20Apps%20Logging%20options.md
[About Logic Apps Logging options - Custom Logging]:{ndr}/Logging%20and%20Monitoring/Azure%20Logic%20Apps/Troubleshooting/About%20Logic%20Apps%20Logging%20options.md#option-4-nodinite-custom-logging
[Azure Logic Apps Agent]:{ndr}/Logging%20and%20Monitoring/Azure%20Logic%20Apps/Overview.md
[Configuration - Logging - Filters]:{ndr}/Logging%20and%20Monitoring/Azure%20Logic%20Apps/Getting%20started/3C.%20Configuration%20-%20Logging.md#fa-filter-understanding-logic-apps-logging-filters
[Cost of Logging]:{ndr}/Getting%20Started/2.%20Log/Logging%20Strategy/Understand%20the%20Cost%20of%20Logging.md
[Custom Logging]:{ndr}/Logging%20and%20Monitoring/Custom%20Logging/Overview.md
[Endpoints]:{ndr}/Repository%20Model/Endpoints/Overview.md
[JSON Log Event]:{ndr}/Core%20Services/Log%20Event/Features/JSON%20Log%20Event.md
[Log Event]:{ndr}/Core%20Services/Log%20Event/Overview.md
[Log Event Details and Repair]:{ndr}/Administration/1.%20Log%20Management/1.%20Log%20Views/Features/View%20Log%20Event%20Details%20and%20Repair.md
[Log Logic Apps at Scale]:{ndr}/Logging%20and%20Monitoring/Azure%20Logic%20Apps/Troubleshooting/Log%20Logic%20Apps%20at%20Scale.md
[Log Logic Apps at Scale - AI]:{ndr}/Logging%20and%20Monitoring/Azure%20Logic%20Apps/Troubleshooting/Log%20Logic%20Apps%20at%20Scale.md#apply-the-naming-policy-with-ai
[Log Logic Apps at Scale - Naming]:{ndr}/Logging%20and%20Monitoring/Azure%20Logic%20Apps/Troubleshooting/Log%20Logic%20Apps%20at%20Scale.md#naming
[Log Logic Apps at Scale - Store less]:{ndr}/Logging%20and%20Monitoring/Azure%20Logic%20Apps/Troubleshooting/Log%20Logic%20Apps%20at%20Scale.md#store-less
[Log Logic Apps at Scale - Two paths]:{ndr}/Logging%20and%20Monitoring/Azure%20Logic%20Apps/Troubleshooting/Log%20Logic%20Apps%20at%20Scale.md#two-paths
[Log Views]:{ndr}/Administration/1.%20Log%20Management/1.%20Log%20Views/Features/What%20is%20a%20Log%20View.md
[Logic Apps TCO]:{ndr}/Logging%20and%20Monitoring/Azure%20Logic%20Apps/Troubleshooting/Reduce%20Azure%20Logic%20Apps%20Run%20History%20Retention%20to%20Lower%20TCO.md
[Message Types]:{ndr}/Repository%20Model/Message%20Types/Overview.md
[Monitoring Azure Service Bus Queue]:{ndr}/Logging%20and%20Monitoring/Message%20Queueing/Features/Azure%20Service%20Bus%20Queues/Monitoring%20Azure%20Service%20Bus%20Queue.md
[Monitoring Function]:{ndr}/Logging%20and%20Monitoring/Azure/Features/Function/Monitoring%20Function.md
[Monitoring Logic Apps]:{ndr}/Logging%20and%20Monitoring/Azure%20Logic%20Apps/Features/Monitoring%20Logic%20Apps.md
[Pickup Service]:{ndr}/Logging%20and%20Monitoring/Pickup%20LogEvents%20Service/Overview.md
[Reduce Azure Functions Logging Costs]:{ndr}/Logging%20and%20Monitoring/Serilog/Troubleshooting/Reduce%20Azure%20Functions%20Logging%20Costs.md
[Serilog]:{ndr}/Logging%20and%20Monitoring/Serilog/Overview.md