> For the complete documentation index, see [llms.txt](https://community-test.logicnets.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://community-test.logicnets.com/release-9/platform-documentation/system-administration/system-settings/log-session-and-trace-file-cleanup.md).

# Log, Session, and Trace File Cleanup

## Description

When a user runs a LogicNets-based application the system writes session files, log files, and trace files to the server, and the number of these files grows over time unless the system cleans them. LogicNets has a cron job--a time-based job scheduler that runs at fixed times, dates, or intervals--to remove those files, and you can configure the age of files targeted for cleanup. The default retention period is 7 days, meaning the system will remove any file older than 7 days at the time the cron job runs.

For heavy-use installations, you may want your System Administrator to define a shorter period of retention. For example, a retention period of 2 days means that every day the cron job looks for files that are more than 2 days old and removes them.

Note: The frequency and timing of the cleanup cron job is currently fixed.

* The cleanup cron job runs once every 24 hours.
* The system sets the timing of the cron job based on the time of installation; for example, if the installation is done at 6am the cron job runs at 6am each day.

## Configuration

To change the cleanup schedule, add the following text to the system *settings.cfg* file located at *\dat\settings.cfg*. Note that your standard installation will not have this configuration setting already in place, and you will need to add it.

The retention period is the number of days a file should remain on the system before being removed and it can be any positive number, stated in days.

```
_global = {
  cleanup = { retention_period = 1, } --days
}
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://community-test.logicnets.com/release-9/platform-documentation/system-administration/system-settings/log-session-and-trace-file-cleanup.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
