Learn more about how to apply these environment variables in [docker-compose](../deploy/docker-compose/index.md#set-environment-variables) and [server](../deploy/docker-single-container/index.md#environment-variables) deployments.
*`json_gcp`: Machine-readable JSON format, tailored to [GCP cloud-logging expected structure.](https://cloud.google.com/logging/docs/structured-logging#special-payload-fields)
* Note that `logfmt` is no longer supported with [Sourcegraph's new internal logging standards](../../dev/how-to/add_logging.md) - if you need structured logs, we recommend using `json` instead. If set to `logfmt`, log output from new loggers will be in `condensed` format.
When [configured to export JSON logs](#log-format), Sourcegraph services that have migrated to the [new internal logging standard](../../dev/how-to/add_logging.md) that will export a JSON log format compliant with [OpenTelemetry's log data model](https://opentelemetry.io/docs/reference/specification/logs/data-model/):
A Sourcegraph service's log level can be configured for a specific `InstrumentationScope` and it's children. For example you can keep your log level at error, but turn on debug logs for a specific component. This is only used to increase verbosity. IE it can't be used to mute a scope.
This is configured by the environment variable `SRC_LOG_SCOPE_LEVEL`. It has the format `SCOPE_0=LEVEL_0,SCOPE_1=LEVEL_1,...`. For example to turn on debug logs for `service.UpdateScheduler` and `repoPurgeWorker` you would set the following on the `repo-updater` service:
Sourcegraph services that have migrated to the [new internal logging standard](../../dev/how-to/add_logging.md) have log sampling enabled by default.
The first 100 identical log entries per second will always be output, but thereafter only every 100th identical message will be output.
This behaviour can be configured for each service using the following environment variables:
*`SRC_LOG_SAMPLING_INITIAL`: the number of entries with identical messages to always output per second
*`SRC_LOG_SAMPLING_THEREAFTER`: the number of entries with identical messages to discard before emitting another one per second, after `SRC_LOG_SAMPLING_INITIAL`.
Setting `SRC_LOG_SAMPLING_INITIAL` to `0` or `-1` will disable log sampling entirely.