# Logger

> For the complete documentation index, see [llms.txt](https://docs.redpanda.com/llms.txt). Component-specific: [connect-full.txt](https://docs.redpanda.com/connect-full.txt)

---
title: Logger
latest-connect-version: 4.93.0
latest-operator-version: v26.1.4
latest-console-tag: v3.7.3
latest-redpanda-tag: v26.1.9
docname: logger/about
page-component-name: connect
page-version: master
page-component-version: master
page-component-title: Connect
page-relative-src-path: logger/about.adoc
page-edit-url: https://github.com/redpanda-data/rp-connect-docs/edit/main/modules/components/pages/logger/about.adoc
page-git-created-date: "2024-05-24"
page-git-modified-date: "2024-10-04"
---

<!-- Source: https://docs.redpanda.com/connect/components/logger/about.md -->

Redpanda Connect logging prints to stdout (or stderr if your output is stdout) and is formatted as [logfmt](https://brandur.org/logfmt) by default. Use these configuration options to change both the logging formats as well as the destination of logs.

> 💡 **TIP**
>
> You can also configure the [`redpanda` component](https://docs.redpanda.com/connect/components/redpanda/about/) to send logs and status updates to topics on a Redpanda cluster.

#### Common

```yaml
# Common config fields, showing default values
logger:
  level: INFO
  format: logfmt
  add_timestamp: false
  static_fields:
    '@service': redpanda-connect
```

#### Advanced

```yaml
# All config fields, showing default values
logger:
  level: INFO
  format: logfmt
  add_timestamp: false
  level_name: level
  timestamp_name: time
  message_name: msg
  static_fields:
    '@service': redpanda-connect
  file:
    path: ""
    rotate: false
    rotate_max_age_days: 0
```

## [](#fields)Fields

The schema of the `logger` section is as follows:

### [](#level)`level`

Set the minimum severity level for emitting logs.

**Type**: `string`

**Default**: `"INFO"`

Options: `OFF` , `FATAL` , `ERROR` , `WARN` , `INFO` , `DEBUG` , `TRACE` , `ALL` , `NONE`

### [](#format)`format`

Set the format of emitted logs.

**Type**: `string`

**Default**: `"logfmt"`

Options: `json` , `logfmt`

### [](#add_timestamp)`add_timestamp`

Whether to include timestamps in logs.

**Type**: `bool`

**Default**: `false`

### [](#level_name)`level_name`

The name of the level field added to logs when the `format` is `json`.

**Type**: `string`

**Default**: `"level"`

### [](#timestamp_name)`timestamp_name`

The name of the timestamp field added to logs when `add_timestamp` is set to `true` and the `format` is `json`.

**Type**: `string`

**Default**: `"time"`

### [](#message_name)`message_name`

The name of the message field added to logs when the `format` is `json`.

**Type**: `string`

**Default**: `"msg"`

### [](#static_fields)`static_fields`

A map of key/value pairs to add to each structured log.

**Type**: `object`

**Default**: `{"@service":"redpanda-connect"}`

### [](#file)`file`

Experimental: Specify fields for optionally writing logs to a file.

**Type**: `object`

### [](#file-path)`file.path`

The file path to write logs to, if the file does not exist it will be created. Leave this field empty or unset to disable file based logging.

**Type**: `string`

**Default**: `""`

### [](#file-rotate)`file.rotate`

Whether to rotate log files automatically.

**Type**: `bool`

**Default**: `false`

### [](#file-rotate_max_age_days)`file.rotate_max_age_days`

The maximum number of days to retain old log files based on the timestamp encoded in their filename, after which they are deleted. Setting to zero disables this mechanism.

**Type**: `int`

**Default**: `0`