---
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 :Nodinite: 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.*

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

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

## :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][].
* **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.

## :fa-lightbulb: 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. :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.

>[!TIP]
>Use the :Nodinite: [Database Monitoring Agent][] to get alerts when databases grow too large and the [Windows Server Monitoring Agent][] to get alerts before you run out of disk space.

## :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 Events* 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-file-code: [DaysToKeepMessageDataDefault][]  
* :fa-key: [DaysToKeepMessageContextDefault][]  
* :fa-clock: [CleanUpTimerInterval][]  
* :fa-calendar-xmark: [DaysToKeepErrorEventsWithoutData][]  
* :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
[Database Monitoring Agent]:{ndr}/Logging%20and%20Monitoring/Database/Overview.md
[DaysToKeepErrorEventsWithoutData]:{ndr}/Administration/5.%20Settings/5.%20System%20Parameters/DaysToKeepErrorEventsWithoutData.md
[DaysToKeepMessageContextDefault]:{ndr}/Administration/5.%20Settings/5.%20System%20Parameters/DaysToKeepMessageContextDefault.md
[DaysToKeepMessageDataDefault]:{ndr}/Administration/5.%20Settings/5.%20System%20Parameters/DaysToKeepMessageDataDefault.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_DaysToKeepMessageEventsDefault.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
[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
[Windows Server Monitoring Agent]:{ndr}/Logging%20and%20Monitoring/Windows%20Server/Overview.md