---
title: DaysToKeepMessageContextDefault System Parameter – Default Context Retention for New Message Types
description: DaysToKeepMessageContextDefault sets the Days to keep Context value that Nodinite copies onto each new Message Type. Learn what context removal deletes, what stays searchable, and why existing Message Types never change.
---

# DaysToKeepMessageContextDefault - System Parameter

The **DaysToKeepMessageContextDefault** [System Parameter][System Parameters] sets the default *Days to keep Context* 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][] removes the context properties (the key-value pairs logged with a [Log Event][]) once they are older than the Message Type's own value, and keeps the event itself.

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

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

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

| Property | Value |
| --- | --- |
| Key | `DaysToKeepMessageContextDefault` |
| 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 Context* 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 5.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][].
* **Context belongs to the event.** Each Message Type has three retention values: Events, Data, and Context. Deleting an event always deletes its context, so this value only matters when it is *shorter* than the events value set by [DaysToKeepMessageEventsDefault][]. A Message Type's *Days to keep Context* cannot exceed its *Days to keep Events*. Message bodies have their own value, [DaysToKeepMessageDataDefault][].
* **What goes and what stays.** Context removal deletes the context properties described in [Context Options][]. [Search Field][Search Fields] values are stored with the event, not with the context, so they stay searchable until the event itself is deleted.
* **Context is 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.

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

* The default is `14` days. Keep context properties as long as users need them to troubleshoot or act on events, and for fewer days than events when the properties are large or sensitive.
* A value of `0` makes new Message Types remove context on the next cleanup run.
* Without this parameter, new Message Types get the [DaysToKeepMessageDataDefault][] value for their context too.

## <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 Context* 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-envelope-open-text" aria-hidden="true"></i> [DaysToKeepMessageEventsDefault][]  
* <i class="fal fa-file-code" aria-hidden="true"></i> [DaysToKeepMessageDataDefault][]  
* <i class="fal fa-clock" aria-hidden="true"></i> [CleanUpTimerInterval][]  
* <i class="fal fa-calendar-day" aria-hidden="true"></i> [DaysToSplitDatabaseOn][]  
* <i class="fal fa-sliders" aria-hidden="true"></i> [Context Options][]  
* <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/
[Context Options]:https://docs.nodinite.com/core-services/log-event/features/context-options/
[Data Retention]:https://docs.nodinite.com/core-services/logging-service/overview/#data-retention
[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/
[Endpoints]:https://docs.nodinite.com/repository-model/endpoints/overview/
[Hero]:https://docs.nodinite.com/media/Documentation%20Pictures/IM/CoreServices/ConfigurationDatabase/SystemParameters/SystemParameters_DaysToKeepMessageContextDefault.gif
[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/
[MCP Endpoint]:https://docs.nodinite.com/core-services/mcp-endpoint/overview/
[Message Type]:https://docs.nodinite.com/repository-model/message-types/overview/
[Search Fields]:https://docs.nodinite.com/administration/log-management/search-fields/overview/
[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/