---
title: Plan Logging Volume, Statistics, and Retention per Message Type
description: "Plan Nodinite logging volume and retention: turn on all logging in test, including every BizTalk tracking option, to measure the real volume, read it in the Message Type and Endpoint statistics, then keep each format for as long as it is worth with retention per Message Type."
---

# <i class="fal fa-database" aria-hidden="true"></i> Plan Volume and Retention

Logging everything forever swamps any database; logging too little leaves you blind on the bad day. The way out is to measure first and then decide per format: keep the high-volume heartbeat messages for days, and the orders and invoices auditors ask about for years. <span class="nodinite-product-name" title="The node that unites different systems. Or as we call it Nodinite">Nodinite</span> sets retention per [Message Type][Message Types], with no quotas, so the decision is yours, not the product's.

* ✅ Know the real volume per format before you go to production  
* ✅ Keep each format exactly as long as it is worth  
* ✅ Keep the traffic statistics, whatever you delete  

<h2 id="understanding"><i class="fal fa-network-wired" aria-hidden="true"></i> Understanding Volume and Retention</h2>

<div class="mermaid">
flowchart LR
    Measure["fa:fa-toggle-on Turn everything on<br/>in test"] --> Stats["fa:fa-chart-bar Read the statistics<br/>per Message Type"]
    Stats --> Decide["fa:fa-scale-balanced Decide days to keep<br/>per Message Type"]
    Decide --> Clean["fa:fa-broom Logging Service<br/>removes older data"]
    style Measure fill:#2678BD
    style Stats fill:#2678BD
    style Decide fill:#E47528
    style Clean fill:#3F827B
</div>

*Measure (blue) before you decide (orange); the [Logging Service][] (teal) then removes events, context, and bodies older than each [Message Type][Message Types] allows, and new [Log Databases][] are created as the online one grows.*

<h2 id="measure">Step 1: Turn Everything On in Test</h2>

You can't plan a volume you haven't seen. In test, or in a production pilot, log everything for a week of normal business:

* **BizTalk Server**: enable tracking on every port, orchestration, and pipeline, with message bodies. Use [Tracking][] in a [Monitor View][Monitor Views], which is audited and needs no BizTalk administrator rights, or the PowerShell script in [Recommendations for BizTalk Logging][BizTalkLoggingRecommendations], which also tunes the BizTalk tracking database.  
* **Other platforms**: turn on logging in every integration, with bodies and context; see [Log from Your Integration Platform][].  
* [Azure Logic Apps][Logic Apps Agent]: the exception. Measure with the Logging filters you'll use in production, not with an empty filter: logging every Action runs into Azure's API limits at high volume. See [Log Logic Apps at Scale][].  

You can always log less later. Logging that was never on can't be turned on for last month.

<h2 id="statistics">Step 2: Read the Statistics</h2>

![Find the Message Type with the biggest bodies and read its number of events, animated walkthrough (7.13)][2]  
*Animated walkthrough: sort the [Message Types][] on body size, then open one's **Statistics** tab for its number of events.*  

1. Open **Administration** > **Message Types**, and filter on the formats you measure, such as `O2C`.
2. Click **Max Body Size** twice to sort the biggest bodies first.
3. Open the [Message Type][Message Types], such as **O2C.Order.Received/1.0**, and select the **Statistics** tab.
4. Open **Information**: **First Event**, **Last Event**, **Number of Events**, **Max Body Size**, and **Max Recent Body Size**, each with **Reset**.
5. The chart and table below show the number of events per [Endpoint][Endpoints], with each Endpoint's first and last event.

![Statistics tab of a Message Type with events per Endpoint (7.13)][1]  
*The **Statistics** tab of a [Message Type][Message Types]: events per [Endpoint][Endpoints] over time, with each Endpoint's first and last event and total count.*  

<span class="nodinite-product-name" title="The node that unites different systems. Or as we call it Nodinite">Nodinite</span> keeps perpetual traffic statistics for every [Message Type][Message Types] and every [Endpoint][Endpoints], with no setup:

* The [Message Type statistics][Message Types - Statistics] show how much of each format travels, and where. The list of Message Types has no event count: sort it on **Max Body Size** to find the formats with the biggest bodies, then open a Message Type's **Statistics** tab. **Information** gives its **Number of Events**, and the table its events per Endpoint.  
* The [Endpoint statistics][Endpoint Statistics] show which formats pass each channel.  
* The [Dashboard][] shows the number of [Log Events][Log Event] per day, so a sudden rise or drop stands out.  

The statistics also answer the questions after go-live: is the old Endpoint quiet yet, does anyone still send version 1.0, how many orders did we get last quarter.

<h2 id="retention">Step 3: Set Retention per Message Type</h2>

Each [Message Type][Message Types] has three **Days to keep** values on its **Retention** tab: for events, for context, and for bodies. Keep the event longer than the body: the event proves *that* something happened, the body *what*. [Add or manage Message Type][] shows where to set them.

![Set days to keep events and bodies on the Retention tab of a Message Type, animated walkthrough (7.13)][3]  
*Animated walkthrough: keep the events of an order format for two years and its bodies for a month.*  

1. Open the [Message Type][Message Types]. The **Retention** tab's header shows the days for events, context, and bodies, such as 365 for each.
2. On the **Retention** tab, set **Days to keep Events** to `730` and **Days to keep Bodies** to `30`.
3. Click **Save**. The tab header now reads 730, 365, and 30.

| Format | Typical choice |
| --- | --- |
| Heartbeats, polling, status pings | Events for days, no bodies |
| Orders, invoices, and other business documents | Events and bodies as long as audit or law requires, often years |
| Sensitive data, such as personal data | Bodies as short as the business allows |
| Debug and trace events | Days |

New Message Types get their values from the [System Parameters][]: [DaysToKeepMessageEventsDefault][], [DaysToKeepMessageContextDefault][], and [DaysToKeepMessageDataDefault][]. Error events with no body follow [DaysToKeepErrorEventsWithoutData][]. Set these defaults before go-live, so a new format doesn't keep data longer than you meant.

<h2 id="log-databases">Step 4: Plan the Log Databases</h2>

<span class="nodinite-product-name" title="The node that unites different systems. Or as we call it Nodinite">Nodinite</span> stores the events in [Log Databases][] and starts a new one when the online database reaches [SizeToSplitDatabaseOn][] or [DaysToSplitDatabaseOn][], so no single database grows without limit. Size the SQL Server for the volume you measured and the retention you chose; see [System Parameters for Log Databases][Log Databases - System Parameters]. In Azure, see [Azure Costs for Blob Storage and Event Hub][] for the intermediate storage.

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

* <i class="fal fa-compass" aria-hidden="true"></i> [Plan Your Logging with Nodinite][Logging Strategy]  
* <i class="fal fa-search" aria-hidden="true"></i> [Working with Nodinite Log Views][Log Overview]  

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

* <i class="fal fa-file" aria-hidden="true"></i> [Message Types][]  
* <i class="fal fa-database" aria-hidden="true"></i> [Log Databases][]  
* <i class="fal fa-sliders" aria-hidden="true"></i> [System Parameters][]  
* <i class="fal fa-envelope-open" aria-hidden="true"></i> [Tracking][]  
* <i class="fal fa-lightbulb" aria-hidden="true"></i> [Recommendations for BizTalk Logging][BizTalkLoggingRecommendations]  
* <i class="fal fa-file-code" aria-hidden="true"></i> [Log the Payload and Context][]  

[1]:https://docs.nodinite.com/media/Documentation%20Pictures/IM/WebClient/Repository/MessageTypes/Statistics.png
[2]:https://docs.nodinite.com/media/Documentation%20Pictures/IM/WebClient/Repository/MessageTypes/MessageType_Statistics.gif
[3]:https://docs.nodinite.com/media/Documentation%20Pictures/IM/WebClient/Repository/MessageTypes/MessageType_Retention.gif

[Add or manage Message Type]:https://docs.nodinite.com/getting-started/repository/message-types/add-or-manage-message-type/
[Azure Costs for Blob Storage and Event Hub]:https://docs.nodinite.com/logging-and-monitoring/custom-logging/troubleshooting/azure-costs-for-blob-storage-and-event-hub/
[BizTalkLoggingRecommendations]:https://docs.nodinite.com/logging-and-monitoring/microsoft-biztalk-server-logging/getting-started/recommendations/
[Dashboard]:https://docs.nodinite.com/getting-started/dashboard/overview/
[DaysToKeepErrorEventsWithoutData]:https://docs.nodinite.com/administration/settings/system-parameters/daystokeeperroreventswithoutdata/
[DaysToKeepMessageContextDefault]:https://docs.nodinite.com/administration/settings/system-parameters/daystokeepmessagecontextdefault/
[DaysToKeepMessageDataDefault]:https://docs.nodinite.com/administration/settings/system-parameters/daystokeepmessagedatadefault/
[DaysToKeepMessageEventsDefault]:https://docs.nodinite.com/administration/settings/system-parameters/daystokeepmessageeventsdefault/
[DaysToSplitDatabaseOn]:https://docs.nodinite.com/administration/settings/system-parameters/daystosplitdatabaseon/
[Endpoint Statistics]:https://docs.nodinite.com/repository-model/endpoints/overview/#fa-chart-bar-statistics
[Endpoints]:https://docs.nodinite.com/repository-model/endpoints/overview/
[Log Databases]:https://docs.nodinite.com/core-services/log-databases/overview/
[Log Databases - System Parameters]:https://docs.nodinite.com/core-services/log-databases/overview/#system-parameters-for-log-databases
[Log Event]:https://docs.nodinite.com/core-services/log-event/overview/
[Log from Your Integration Platform]:https://docs.nodinite.com/getting-started/log/logging-strategy/log-from-your-integration-platform/
[Log Logic Apps at Scale]:https://docs.nodinite.com/logging-and-monitoring/azure-logic-apps/troubleshooting/log-logic-apps-at-scale/
[Log Overview]:https://docs.nodinite.com/getting-started/log/overview/
[Log the Payload and Context]:https://docs.nodinite.com/getting-started/log/logging-strategy/log-the-payload-and-context/
[Logging Service]:https://docs.nodinite.com/core-services/logging-service/overview/
[Logging Strategy]:https://docs.nodinite.com/getting-started/log/logging-strategy/overview/
[Logic Apps Agent]:https://docs.nodinite.com/logging-and-monitoring/azure-logic-apps/overview/
[Message Types]:https://docs.nodinite.com/repository-model/message-types/overview/
[Message Types - Statistics]:https://docs.nodinite.com/repository-model/message-types/overview/#fa-chart-bar-statistics
[Monitor Views]:https://docs.nodinite.com/administration/monitor-management/monitor-views/features/what-is-a-monitor-view/
[SizeToSplitDatabaseOn]:https://docs.nodinite.com/administration/settings/system-parameters/sizetosplitdatabaseon/
[System Parameters]:https://docs.nodinite.com/administration/settings/system-parameters/overview/
[Tracking]:https://docs.nodinite.com/logging-and-monitoring/microsoft-biztalk-server-monitoring/features/tracking/overview/