Copy as Markdown[Open in ChatGPT](https://chatgpt.com/?q=Read%20https%3A%2F%2Fdocs-docusaurus.kinsta.page%2Fuser-guides%2Frum%2Fsdk-features%2Fcustom-logs.md%20and%20help%20me%20with%20my%20question%20about%20this%20Coralogix%20documentation%20page.)[Open in Claude](https://claude.ai/new?q=Read%20https%3A%2F%2Fdocs-docusaurus.kinsta.page%2Fuser-guides%2Frum%2Fsdk-features%2Fcustom-logs.md%20and%20help%20me%20with%20my%20question%20about%20this%20Coralogix%20documentation%20page.)

# Custom logs

## Overview[​](#overview "Direct link to Overview")

Send log messages with customized severity levels, extra data and/or custom labels. Use `CoralogixLogSeverity` to define severity levels for logs in the Coralogix system.

Note

You can pass any `key:value` to the extra data object.

| Case       | Raw value | Severity level |
| ---------- | --------- | -------------- |
| `debug`    | 1         | Debug          |
| `verbose`  | 2         | Verbose        |
| `info`     | 3         | Informational  |
| `warn`     | 4         | Warning        |
| `error`    | 5         | Error          |
| `critical` | 6         | Critical       |

## Examples[​](#examples "Direct link to Examples")

### Custom severity level[​](#custom-severity-level "Direct link to Custom severity level")

```
CoralogixRum.log(

    CoralogixLogSeverity.Error,

    "Custom log message error"

)
```

### Custom severity level, extra data[​](#custom-severity-level-extra-data "Direct link to Custom severity level, extra data")

```
CoralogixRum.log(

    CoralogixLogSeverity.Error, 'this is an error custom log with extra data', { data: 'tbd' });

)
```

### Direct severity level call, extra data[​](#direct-severity-level-call-extra-data "Direct link to Direct severity level call, extra data")

```


CoralogixRum.error('this is a custom log with error severity', { data: 'tbd' });

)
```

### Custom log, extra data and label[​](#custom-log-extra-data-and-label "Direct link to Custom log, extra data and label")

```


CoralogixRum.warning(

  'this is a custom log message with warning severity',

  {

    data: 'tbd',

  },

  {

    my_label_key: 'my label value',

  }

);
```

### Custom severity level, optional extra data (unless label is provided)[​](#custom-severity-level-optional-extra-data-unless-label-is-provided "Direct link to Custom severity level, optional extra data (unless label is provided)")

The extra data is optional unless labels are specified. If labels are present, extra data becomes required, though it may be set to `null` if no data is available.

```


CoralogixRum.log(CoralogixLogSeverity.Info, 'this is a custom log message with info severity', null, {

  my_label_key: 'my label value',

});
```
