> For the complete documentation index, see [llms.txt](https://help.santesuite.org/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://help.santesuite.org/operations/server-administration/log-file-management.md).

# Log File Management

## iCDR Log Files

iCDR log files are, by default, stored in the following directories:

* **Microsoft Windows Operating Systems:** `C:\Program Files\SanteSuite\SanteDB\Server`&#x20;
* **Linux Operating Systems:** `/opt/santesuite/santedb/server`
* **Docker:** `/var/log/`

Administrators can change the location of the log file changing the write location on the [Diagnostics Configuration](/operations/server-administration/host-configuration-file/diagnostics-configuration.md)section and restarting the process.&#x20;

Log files are stored in a rolling name format `santedb_yyyyMMdd.log` and are **never purged automatically**.&#x20;

{% hint style="info" %}
Administrators MUST set up scheduled tasks to remove or prune their log files according to their own operational policies. Failing to manage log files will eventually result in server disks running out of space, potentially causing service outages.&#x20;
{% endhint %}

## dCDR Log Files

dCDR log files are stored in the following locations:

* **Microsoft Windows Operating Systems:**&#x20;
  * dCDR Gateway: `%systemroot%\SysWOW64\config\systemprofile\local\log\`
  * dCDR Applications: `%localappdata%\log`
* **Linux Operating Systems:**
  * dCDR Gateway: `~root/.local/log`
  * dCDR Applications: `~/.local/log`
* **Docker**: `/root/.local/log`&#x20;

## Log Format

Log files for the dCDR and iCDR have a format as described below:

```
Source@ThreadID <Level> [TIMESTAMP]: Log Message
```

For example, this log entry indicates an ERROR on 2021-01-05 from the FHIR plugin on thread 7:

```
SanteDB.Messaging.FHIR@RSRVR-ThreadPoolThread-7 <Error> [2021-01-05T00:45:15.9914111-05:00]: Error on WCF FHIR Pipeline: SanteDB.Core.Exceptions.PolicyViolationException: Policy '1.3.6.1.4.1.33349.3.1.5.9.2.2.0' was violated by 'Administrator' with outcome 'Deny'
```

Using the ThreadID is helpful when diagnosing issues in a production environment as it allows for the tracking of a client's execution pathway through the solution.


---

# 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 dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://help.santesuite.org/operations/server-administration/log-file-management.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
