Azure Functions + Nodinite: Reduce Logging Costs and TCO
Azure Functions send their logs to Application Insights by default, and many teams log message payloads there as well. Application Insights stores that data in a Log Analytics workspace, billed per GB ingested and per GB retained. When you also log the same payloads to Nodinite with the Serilog sinks, you pay for them twice.
In short: Nodinite can lower your Azure costs when it replaces payload logging and long retention in Application Insights. Your actual savings depend on your log volume, payload sizes, retention, Azure pricing, and on the Nodinite license and SQL Server costs. This page covers only what's specific to Azure Functions; the shared cost model is on Azure Costs for Blob Storage and Event Hub.
Understanding the two logging paths
for developers"] FN -->|Business payloads via Serilog| NOD["fa:fa-database Nodinite
for developers and the business"] style FN fill:#2678BD style AI fill:#E47528 style NOD fill:#93d16d
Diagram: Keep Application Insights (orange) for performance telemetry, and log business payloads once to Nodinite (green).
| Destination | Best at | Limits that matter for payloads |
|---|---|---|
| Application Insights | Requests, dependencies, exceptions, performance, and live debugging for developers | Trace messages are limited to 32,768 characters and telemetry items to 64 KB; Azure Functions sample telemetry by default, so it isn't a record of every message |
| Nodinite | Every business message with its full payload, searchable by business data, with retention per Message Types | Staging cost in Blob Storage or Event Hub; see Azure Costs for Blob Storage and Event Hub |
Where the duplicate cost is
In Functions, payloads usually end up in Application Insights in one of these ways:
logger.LogInformation(...)calls that write the message body, which land in thetracestable- a default log level of
Informationfor all categories inhost.json, so every user log is sent - longer retention on the workspace, to keep message history for audits
What these payloads cost per GB in Log Analytics, with and without long retention, is shown in the yearly cost table for API Management: the per-GB prices are the same for Functions.
Keep Application Insights lean
When Nodinite logs the business payloads, keep Application Insights for what it does best and stop sending payloads there:
- Log message bodies only through the Nodinite Serilog sink, not through the logger that feeds Application Insights. See How To Start Logging With Serilog and ILogger in Azure Functions.
- In
host.json, set the default log level toWarningand keepHost.ResultsatInformation, so you still get every function run in therequeststable. - Keep sampling enabled, and exclude
RequestandExceptionfrom sampling so failures are never dropped. - Keep the workspace retention at the included period; Nodinite keeps the long-term history.
{
"version": "2.0",
"logging": {
"logLevel": {
"default": "Warning",
"Host.Results": "Information",
"Host.Aggregator": "Information"
},
"applicationInsights": {
"samplingSettings": {
"isEnabled": true,
"excludedTypes": "Request;Exception"
}
}
}
}
Example: a lean Application Insights setup for Azure Functions. See Configure monitoring for Azure Functions for every option.
Tip
During a migration, Serilog can write to both destinations at the same time; see the Serilog FAQ. Remove the payloads from Application Insights once Nodinite has them.
Give the business access, not only developers
Application Insights is a developer tool: access goes through Azure RBAC, and searching means writing KQL. With role-based access in Nodinite, business users search the same Function messages by Order ID or Invoice Number in Log Views, limited by their Roles, and in the same view as your Logic Apps and API Management traffic. Read why this matters in Built for developers and the business.
Next Steps
- How To Start Logging With Serilog
- How To Start Logging With ILogger in Azure Functions
- Configure Message Types
Related Topics
- Azure Costs for Blob Storage and Event Hub
- Reduce Azure API Management Logging Costs — the same approach for API Management
- Reduce Azure Logic Apps Run History Retention to Lower TCO — the same approach for Logic Apps
- Serilog
- Serilog FAQ
- Log Views
- Roles