# LogsSettings

**Kind**: interface | **Module**: [Insights](https://docs.interop.io/browser/reference/javascript/insights/index.md)

**Source**: https://docs.interop.io/browser/reference/javascript/insights/logssettings/index.html

## Properties

- **`additionalAttributes`** (`{ [x: string]: unknown } | (() => { [x: string]: unknown })`, optional)
  Additional logs attributes to publish as part of each log entry, specified as key/value pairs. You can use environment variables as values. Environment variables must start and end with a percent sign (e.g., `%MyEnvVar%`), and can contain a fallback value (e.g., `%MyEnvVar?literalDefaultValue%`).
- **`additionalResourceAttributes`** (`{ [x: string]: unknown } | (() => { [x: string]: unknown })`, optional)
  Additional attributes to publish as part of the OTEL resource definition, specified as key/value pairs. You can use environment variables as values. Environment variables must start and end with a percent sign (e.g., `%MyEnvVar%`), and can contain a fallback value (e.g., `%MyEnvVar?literalDefaultValue%`).

  A function is asked once, on the first read after the build, and its answer is kept: the
  SDK's resource is made once, at its creation, and the readers that look at the resource
  attributes on every span (the span filters' context, the sampler) see the same values.
- **`addResourceAttributesToAttributes`** (`boolean`, optional) default: `false`
  Whether to add resource attributes to log entry attributes.
- **`attributeSettings`** (`{ [x: string]: AttributeSettings }`, optional)
  Controls the publishing of specific attributes of the log records, by name. An entry
  names an attribute by its flattened (dot-separated) name, or everything nested under it -
  `"user"` covers `"user.id"` - and the most specific entry is the one that applies to an
  attribute. See `AttributeSettings` for what an entry does (`"allow"`, `"drop"`,
  `"mask"`), and `attributeSettingsMode` for whether the entries are a block list (the
  default) or an allow list.

  Applies to the attributes of every log record - its own and the additional attributes -
  after the log filters (which match on the attributes as they came, and have
  `allowedAttributes` of their own). The attributes of a log record may be nested, and are
  published as they are: a nested attribute is named by its dotted path
  (`"user.id"` for `{ user: { id } }`), a dropped one is taken out of its map - and the
  map with it, when nothing is left in it - and under a `"mask"` entry each nested value
  is masked on its own. A masked value is hashed as everywhere else - keyed per the
  top-level `maskingSettings`, 16 characters - so the same value masks to the same string
  on a log record, a span and a metric value, and is reported to `mappingURL` the same
  way.

  The `"drop"` and `"mask"` entries - never as an allow list - also apply to the resource
  attributes the logs are published with.
- **`attributeSettingsMode`** (`AttributeSettingsMode`, optional)
  How the `attributeSettings` read: `"blocklist"` (the default) publishes everything except
  the attributes with a `"drop"` entry - an `"allow"` entry is the exception to a broader
  `"drop"` (`"user"` dropped, `"user.name"` allowed); `"allowlist"` publishes only the
  attributes with an `"allow"` or a `"mask"` entry - without any entries, no attributes at
  all. About the attributes of the log records: the resource attributes are never read as
  an allow list.
- **`compression`** (`CompressionAlgorithm`, optional)
  Compression algorithm to use when exporting logs.
- **`concurrencyLimit`** (`number`, optional)
  Maximum number of concurrent logs export requests.
- **`defaults`** (`LogOptions`, optional)
  Default settings if appropriate entries aren't found
  in 'filters' collection.
- **`enabled`** (`boolean`, required) default: `false`
  Whether logging functionality is enabled.
  If disabled, API is still usable, but methods are no-ops.
- **`exporterSettings`** (`OTLPExporterConfigBase`, optional)
  Settings for the OTLP exporter used to send logs.
- **`filters`** (`LogFilter[]`, optional)
  Array of filter entries used to determine whether
  a particular log entry will be emitted, and
  which attributes will be included.

  If no matching filter entry is found,
  the settings from 'defaults' are used.
- **`headers`** (`{ [x: string]: string } | (() => { [x: string]: string }) | (() => Promise<{ [x: string]: string }>)`, optional)
  Additional headers to send in HTTP requests, e.g. when using HTTP exporters.
- **`keepAlive`** (`boolean`, optional) default: `true`
  Whether to keep the connection alive when sending logs.
- **`logExporters`** (`(exporterSettings: OTLPExporterNodeConfigBase, settings: LogsSettings, otelSettings: Settings) => LogRecordExporter[]`, optional)
  Log record exporters.
- **`loggerProvider`** (`(loggerProviderSettings: LoggerProviderConfig, settings: LogsSettings, otelSettings: Settings) => LoggerProvider`, optional)
  Logger provider instance.
- **`loggerProviderSettings`** (`LoggerProviderConfig`, optional)
  Configuration for the logger provider.
- **`logProcessors`** (`(processorSettings: BatchLogRecordProcessorOptions | undefined, exporterSettings: OTLPExporterNodeConfigBase, settings: LogsSettings, otelSettings: Settings) => LogRecordProcessor[]`, optional)
  Log record processors.
- **`maxAttributeDepth`** (`number`, optional) default: `5`
  How deep the library should recurse into objects when adding
  labels to logs.
- **`processorSettings`** (`BatchLogRecordProcessorOptions`, optional)
  Settings for batching log records before export.
- **`publishInterval`** (`number`, optional)
  Interval in milliseconds between logs export batches.
- **`ssoAuth`** (`SSOAuthSettings`, optional)
  Overrides the properties of the top-level `ssoAuth` for the logs export requests; the ones
  that aren't specified here are taken from it.
- **`timeoutMillis`** (`number`, optional) default: `10000ms.`
  Maximum time the OTLP exporter will wait for each batch export.
- **`url`** (`string`, optional)
  OTLP logs exporter endpoint URL.
- **`useDefaultFilters`** (`boolean`, optional) default: `true`
  If true, use a predefined list of filters for well-known
  platform logs.

## Related types

- [AttributeSettings](https://docs.interop.io/browser/reference/javascript/insights/attributesettings/index.md)
- [AttributeSettingsMode](https://docs.interop.io/browser/reference/javascript/insights/attributesettingsmode/index.md)
- [LogFilter](https://docs.interop.io/browser/reference/javascript/insights/logfilter/index.md)
- [LogOptions](https://docs.interop.io/browser/reference/javascript/insights/logoptions/index.md)
- [SSOAuthSettings](https://docs.interop.io/browser/reference/javascript/insights/ssoauthsettings/index.md)
- [Settings](https://docs.interop.io/browser/reference/javascript/insights/settings/index.md)
