---
title: DaysToKeepMessageDataDefault System Parameter – Default Message Body Retention for New Message Types
description: DaysToKeepMessageDataDefault sets the Days to keep Bodies value that Nodinite copies onto each new Message Type. Keep message bodies shorter than events to save disk space while still recording that a transaction happened.
---

# DaysToKeepMessageDataDefault - System Parameter

The **DaysToKeepMessageDataDefault** [System Parameter][System Parameters] sets the default *Days to keep Bodies* value that :Nodinite: copies onto every new [Message Type][]. The [Logging Service][] removes the message data (the message body, or payload) of a [Log Event][] once it is older than the Message Type's own value, and keeps the event itself.

![DaysToKeepMessageDataDefault set from 14 to 3 and saved, Add Message Type starting its Retention tab with Days to keep Bodies 3, then the Message Types list filtered on Contoso.Billing showing Contoso.Billing.Statement (added in the form) and Contoso.Billing.Reminder (created by the Logging Service from a new event), both with Bodies 3 and Events and Context 14, animated walkthrough (7.12)][Hero]  
*Animated walkthrough: after the value is set from 14 to 3, both ways of creating a Message Type use it. The **Add Message Type** form starts its **Retention** tab with 3, and the [Logging Service][] gives 3 to a Message Type it creates from a new event.*

1. Filter the [System Parameters][] list on the key and open **DaysToKeepMessageDataDefault**.
2. Change the value from `14` to `3` and **Save**.
3. Go to **Repository** &gt; **Message Types** and select **Add Message Type**. Name it, open the **Retention** tab: *Days to keep Bodies* starts at `3`. **Save**.
4. Log an event with a Message Type that doesn't exist yet. The Logging Service creates it with *Days to keep Bodies* `3`.
5. Filter the Message Types list: both new Message Types show Bodies `3`, while Events and Context keep `14`.

## :fa-table: At a Glance {#at-a-glance}

| Property | Value |
| --- | --- |
| Key | `DaysToKeepMessageDataDefault` |
| Data type | integer (days) |
| Default | `14` |
| Read by | [Logging Service][], when it creates a [Message Type][] from a new event; [Web Client][], to pre-fill *Days to keep Bodies* in [Add or manage Message Type][] |
| Takes effect | About 15 seconds, for [Message Types][Message Type] created after the change (up to 5 minutes for Message Types the BizTalk [Endpoint][Endpoints] sync creates); no restart needed |
| Status | ✅ Active |
| Since | Nodinite 2 |

## :fa-gears: How It Works

* **A seed, not a live setting.** :Nodinite: copies the value onto a Message Type only when the Message Type is created. Changing the parameter never changes existing Message Types; adjust those one at a time in [Add or manage Message Type][].
* **The body belongs to the event.** Each Message Type has three retention values: Events, Data, and Context. Deleting an event always deletes its body, so this value only matters when it is *shorter* than the events value set by [DaysToKeepMessageEventsDefault][]. A Message Type's *Days to keep Bodies* cannot exceed its *Days to keep Events*. Context properties have their own value, [DaysToKeepMessageContextDefault][].
* **Bodies are removed on each cleanup run** of the Logging Service (see [CleanUpTimerInterval][]). The full retention pipeline is described in the Logging Service [Data Retention][] section.
* **The [Web API][] applies no default.** A Message Type added through the Web API, or through the [MCP Endpoint][], gets the values sent with it, not this default.

## :fa-lightbulb: Choosing a Value

* Message bodies are usually the largest part of what you log, so this value has the biggest effect on the size of the [Log Database][]. The default is `14` days.
* Keep bodies for fewer days than events when you need a record that a transaction happened, but not the full message data for as long; this is a common data-minimisation choice.
* A value of `0` makes new Message Types remove bodies on the next cleanup run.
* :Nodinite: starts new Log Databases when one becomes too old ([DaysToSplitDatabaseOn][]) or too large ([SizeToSplitDatabaseOn][]), but the disk space for retained data is still yours to manage.

## :fa-question: Frequently Asked Questions

### I changed the value. Why are my existing Message Types unchanged?

Because the value only seeds Message Types at creation time. Open each existing Message Type in [Add or manage Message Type][] and change its *Days to keep Bodies* there.

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

* :fa-file: [Add or manage Message Type][]  
* :fa-trash-can: [Data Retention][]  
* :fa-pen-to-square: [Manage System Parameters][]  

## :fa-link-horizontal: Related Topics

* :fa-envelope-open-text: [DaysToKeepMessageEventsDefault][]  
* :fa-key: [DaysToKeepMessageContextDefault][]  
* :fa-clock: [CleanUpTimerInterval][]  
* :fa-calendar-day: [DaysToSplitDatabaseOn][]  
* :fa-hard-drive: [Logging Service][]  
* :fa-cog: [System Parameters][]  

[Add or manage Message Type]:{ndr}/Getting%20Started/4.%20Repository/Message%20Types/Add%20or%20manage%20Message%20Type.md
[CleanUpTimerInterval]:{ndr}/Administration/5.%20Settings/5.%20System%20Parameters/CleanUpTimerInterval.md
[Data Retention]:{ndr}/Core%20Services/Logging%20Service/Overview.md#data-retention
[DaysToKeepMessageContextDefault]:{ndr}/Administration/5.%20Settings/5.%20System%20Parameters/DaysToKeepMessageContextDefault.md
[DaysToKeepMessageEventsDefault]:{ndr}/Administration/5.%20Settings/5.%20System%20Parameters/DaysToKeepMessageEventsDefault.md
[DaysToSplitDatabaseOn]:{ndr}/Administration/5.%20Settings/5.%20System%20Parameters/DaysToSplitDatabaseOn.md
[Endpoints]:{ndr}/Repository%20Model/Endpoints/Overview.md
[Hero]:{ndm}/Documentation%20Pictures/IM/CoreServices/ConfigurationDatabase/SystemParameters/SystemParameters_DaysToKeepMessageDataDefault.gif
[Log Database]:{ndr}/Core%20Services/Log%20Databases/Overview.md
[Log Event]:{ndr}/Core%20Services/Log%20Event/Overview.md
[Logging Service]:{ndr}/Core%20Services/Logging%20Service/Overview.md
[Manage System Parameters]:{ndr}/Administration/5.%20Settings/5.%20System%20Parameters/Manage%20System%20Parameters.md
[MCP Endpoint]:{ndr}/Core%20Services/MCP%20Endpoint/Overview.md
[Message Type]:{ndr}/Repository%20Model/Message%20Types/Overview.md
[SizeToSplitDatabaseOn]:{ndr}/Administration/5.%20Settings/5.%20System%20Parameters/SizeToSplitDatabaseOn.md
[System Parameters]:{ndr}/Administration/5.%20Settings/5.%20System%20Parameters/Overview.md
[Web API]:{ndr}/Core%20Services/Web%20API/Overview.md
[Web Client]:{ndr}/Core%20Services/Web%20Client/Overview.md