---
title: "Logging in Sitecore Managed Cloud Containers"
slug: "logging-in-sitecore-managed-cloud-containers"
abstract: "Learn how to customize logging in Sitecore Managed Cloud Containers."
---
# Logging in Sitecore Managed Cloud Containers

Sitecore Managed Cloud Containers uses an ELK stack to collect and aggregate the log files that are output by the various containers in a Kubernetes cluster. The following diagram illustrates the data flow for a Windows based, Sitecore role container:

![Data flow for a Sitecore role container](https://doc.sitecore.com/api/markdown-image/xp/en/developers/105/managed-cloud/images/ELK_stack_data_flow.png)

## Customize the logging of Sitecore roles

You can customize the logging for a Sitecore role in a Managed Cloud container. To customize the logging for a Sitecore role, you modify the Stdout of the container by editing the configuration file of the Log Monitor. The configuration file for the Log Monitor is stored in `C:\LogMonitor\logmonitorconfig.json` in each container image.

> [!note]
> Increasing the number of log files generated by your AKS cluster can cause storage issues in the Elasticsearch database. This can lead to the loss of some logged data. The retention period for Elasticsearch data is set to 30 days by default.

The base configuration that collects both Sitecore logs, and IIS logs is:

```csharp
{
    "LogConfig": {
        "sources": [
            {
                "type": "File",
                "directory": "c:\\inetpub\\logs",
                "filter": "*.log",
                "includeSubdirectories": true
            },
            {
                "type": "File",
                "directory": "c:\\inetpub\\wwwroot\\App_data\\logs",
                "filter": "log.*.txt",
                "includeSubdirectories": false
            }
        ]
    }
}

```

To update the `logmonitorconfig.json` file, create a new config file and build it into a custom image.

### Common LogMonitor custom configurations

Output all Sitecore logs:

```csharp
{
    "LogConfig": {
        "sources": [
            {
                "type": "File",
                "directory": "c:\\inetpub\\logs",
                "filter": "*.log",
                "includeSubdirectories": true
            },
            {
                "type": "File",
                "directory": "c:\\inetpub\\wwwroot\\App_data\\logs",
                "filter": "*.txt",
                "includeSubdirectories": false
            }
        ]
    }
}

```

Output Windows events and system logs:

```csharp
{
    "LogConfig": {
        "sources": [
            {
                "type": "EventLog",
                "startAtOldestRecord": true,
                "eventFormatMultiLine": false,
                "channels": [
                    {
                         "name": "system",
                         "level": "Information"
                    },
                    {
                         "name": "application",
                         "level": "Error"
                    }
                ]
            },
            {
                "type": "File",
                "directory": "c:\\inetpub\\logs",
                "filter": "*.log",
                "includeSubdirectories": true
            },
            {
                "type": "File",
                "directory": "c:\\inetpub\\wwwroot\\App_data\\logs",
                "filter": "log.*.txt",
                "includeSubdirectories": false
            }
        ]
    }
}

```