---
title: DaysToKeepMessageEventsDefault System Parameter – Default Event Retention for New Message Types
description: DaysToKeepMessageEventsDefault sets the Days to keep Events value that Nodinite copies onto each new Message Type. Learn how event retention relates to body and context retention, and why existing Message Types never change.
---

# DaysToKeepMessageEventsDefault - System Parameter

The **DaysToKeepMessageEventsDefault** [System Parameter][System Parameters] sets the default *Days to keep Events* value that <span class="nodinite-product-name" title="The node that unites different systems. Or as we call it Nodinite">Nodinite</span> copies onto every new [Message Type][]. The [Logging Service][] deletes processed [Log Events][Log Event] once they are older than their Message Type's own value.

![DaysToKeepMessageEventsDefault opened from the System Parameters list, raised from 14 to 30 and saved, then the Message Types list filtered on Contoso.Returns with a Message Type the Logging Service created from a new event showing Events 30 while an existing Message Type keeps Events 14, and the value set back to 14, animated walkthrough (7.12)][Hero]  
*Animated walkthrough: after the value is raised from 14 to 30, a Message Type that the [Logging Service][] creates from a new event gets 30 days for its events. The Message Type that already existed keeps 14.*

<h2 id="at-a-glance"><i class="fal fa-table" aria-hidden="true"></i> At a Glance</h2>

| Property | Value |
| --- | --- |
| Key | `DaysToKeepMessageEventsDefault` |
| 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 Events* 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 3 |

## <i class="fal fa-gears" aria-hidden="true"></i> How It Works

* **A seed, not a live setting.** <span class="nodinite-product-name" title="The node that unites different systems. Or as we call it Nodinite">Nodinite</span> 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][].
* **Events own their body and context.** Each Message Type has three retention values: Events, Data (the message body), and Context (the key-value context properties). When the cleanup run deletes a Log Event, it deletes the event's body and context with it. [DaysToKeepMessageDataDefault][] and [DaysToKeepMessageContextDefault][] let you remove body and context *earlier*, so keep both at or below this value.
* **Only processed events are deleted**, 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 created with `POST api/MessageTypes` stores the retention values the caller sends, so a script must send them itself.
* **No restart.** The Logging Service and the Add form read a changed value within about 15 seconds.

## <i class="fal fa-lightbulb" aria-hidden="true"></i> Choosing a Value

* The default `14` days suits most environments. Raise the value on the Message Types that need a longer history instead of raising the default for all of them.
* A value of `0` makes new Message Types delete their events on the next cleanup run.
* An empty value makes new Message Types keep their events forever. A negative value, a value that isn't a whole number, or a missing parameter gives the default `14`.
* If you log more than you delete, the [Log Database][] keeps growing until it slows down or the disk is full. <span class="nodinite-product-name" title="The node that unites different systems. Or as we call it Nodinite">Nodinite</span> 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.

<aside aria-label="Tip" class="nodinite-note nodinite-note--tip">
<p class="nodinite-note__label" aria-hidden="true"><i class="far fa-fw fa-lightbulb"></i> Tip</p>
<div class="nodinite-note__content"><p>Use the <span class="nodinite-product-name" title="The node that unites different systems. Or as we call it Nodinite">Nodinite</span> <a href="https://docs.nodinite.com/logging-and-monitoring/database/overview/">Database Monitoring Agent</a> to get alerts when databases grow too large and the <a href="https://docs.nodinite.com/logging-and-monitoring/windows-server/overview/">Windows Server Monitoring Agent</a> to get alerts before you run out of disk space.</p></div>
</aside>

## <i class="fal fa-question" aria-hidden="true"></i> 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 Events* there.

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

* <i class="fal fa-file" aria-hidden="true"></i> [Add or manage Message Type][]  
* <i class="fal fa-trash-can" aria-hidden="true"></i> [Data Retention][]  
* <i class="fal fa-pen-to-square" aria-hidden="true"></i> [Manage System Parameters][]  

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

* <i class="fal fa-file-code" aria-hidden="true"></i> [DaysToKeepMessageDataDefault][]  
* <i class="fal fa-key" aria-hidden="true"></i> [DaysToKeepMessageContextDefault][]  
* <i class="fal fa-clock" aria-hidden="true"></i> [CleanUpTimerInterval][]  
* <i class="fal fa-calendar-xmark" aria-hidden="true"></i> [DaysToKeepErrorEventsWithoutData][]  
* <i class="fal fa-calendar-day" aria-hidden="true"></i> [DaysToSplitDatabaseOn][]  
* <i class="fal fa-hard-drive" aria-hidden="true"></i> [Logging Service][]  
* <i class="fal fa-cog" aria-hidden="true"></i> [System Parameters][]  

[Add or manage Message Type]:https://docs.nodinite.com/getting-started/repository/message-types/add-or-manage-message-type/
[CleanUpTimerInterval]:https://docs.nodinite.com/administration/settings/system-parameters/cleanuptimerinterval/
[Data Retention]:https://docs.nodinite.com/core-services/logging-service/overview/#data-retention
[Database Monitoring Agent]:https://docs.nodinite.com/logging-and-monitoring/database/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/
[DaysToSplitDatabaseOn]:https://docs.nodinite.com/administration/settings/system-parameters/daystosplitdatabaseon/
[Endpoints]:https://docs.nodinite.com/repository-model/endpoints/overview/
[Hero]:https://docs.nodinite.com/media/Documentation%20Pictures/IM/CoreServices/ConfigurationDatabase/SystemParameters/SystemParameters_DaysToKeepMessageEventsDefault.gif
[Log Database]:https://docs.nodinite.com/core-services/log-databases/overview/
[Log Event]:https://docs.nodinite.com/core-services/log-event/overview/
[Logging Service]:https://docs.nodinite.com/core-services/logging-service/overview/
[Manage System Parameters]:https://docs.nodinite.com/administration/settings/system-parameters/manage-system-parameters/
[Message Type]:https://docs.nodinite.com/repository-model/message-types/overview/
[SizeToSplitDatabaseOn]:https://docs.nodinite.com/administration/settings/system-parameters/sizetosplitdatabaseon/
[System Parameters]:https://docs.nodinite.com/administration/settings/system-parameters/overview/
[Web API]:https://docs.nodinite.com/core-services/web-api/overview/
[Web Client]:https://docs.nodinite.com/core-services/web-client/overview/
[Windows Server Monitoring Agent]:https://docs.nodinite.com/logging-and-monitoring/windows-server/overview/