---
title: Container logging driver disabled
description: Datadog, the leading service for cloud-scale monitoring.
breadcrumbs: >-
  Docs > Datadog Security > Code Security > Infrastructure as Code (IaC)
  Security > IaC Security Rules > Container logging driver disabled
---

> For the complete documentation index, see [llms.txt](https://docs.datadoghq.com/llms.txt).

# Container logging driver disabled

{% callout %}
# Important note for users on the following Datadog sites: app.ddog-gov.com, us2.ddog-gov.com

{% alert level="danger" %}
This product is not supported for your selected [Datadog site](https://docs.datadoghq.com/getting_started/site.md). ({% placeholder "user-datadog-site-name" /%}).
{% /alert %}

{% /callout %}

## Metadata{% #metadata %}

**Id:** `dockercompose-logging-driver-disabled` 

**Platform:** DockerCompose

**Severity:** Medium

**Category:** Observability

#### Learn More{% #learn-more %}

- [Provider Reference](https://docs.docker.com/reference/compose-file/services/#logging)

### Description{% #description %}

Setting `logging.driver: none` disables all log collection for a container, preventing audit trails, alerting, and forensic analysis of container activity. Without logs, security incidents cannot be detected or investigated, and compliance requirements for activity logging cannot be met. Services should use a logging driver that forwards output to a log aggregation system rather than discarding it.

## Compliant Code Examples{% #compliant-code-examples %}

```yaml
services:
  json_log:
    image: alpine
    logging:
      driver: json-file
      options:
        max-size: 10m
  no_logging:
    image: alpine
```

## Non-Compliant Code Examples{% #non-compliant-code-examples %}

```yaml
services:
  silent:
    image: alpine
    logging:
      driver: none
```
