Logs

Tier: Ultimate Offering: GitLab.com Status: Experiment
History
This feature is only available on GitLab.com. On self-managed GitLab and GitLab Dedicated, by default this feature is not available. This feature is not ready for production use.

GitLab supports centralized application and infrastructure logs collection, storage, and analysis. GiLab Logging provides insight about the operational health of monitored systems. Use logs to learn more about your systems and applications in a given range of time.

Configure logging

Configure logging to enable it for a project.

Prerequisites:

  • You must have at least the Maintainer role for the project.
  1. Create an access token and enable logs:
    1. On the left sidebar, select Search or go to and find your project.
    2. Select Settings > Access Tokens.
    3. Create an access token with the following scopes: read_api, read_observability, write_observability. Be sure to save the access token value for later.
    4. Select Monitor > Logs, and then select Enable.
  2. To configure your application to send GitLab logs, set the following environment variables:

    OTEL_EXPORTER = "otlphttp"
    OTEL_EXPORTER_OTLP_LOGS_ENDPOINT = "https://observe.gitlab.com/v3/<namespace-id>/<gitlab-project-id>/ingest/logs"
    OTEL_EXPORTER_OTLP_LOGS_HEADERS = "PRIVATE-TOKEN=<gitlab-access-token>"
    

    Use the following values:

    • namespace-id - The top-level group ID that contains the project
    • gitlab-project-id - The project ID
    • gitlab-access-token - The access token you created

Logs are configured for your project. When you run your application, the OpenTelemetry exporter sends logs to GitLab.

View logs

You can view the logs for a given project:

  1. On the left sidebar, select Search or go to and find your project.
  2. Select Monitor > Logs.

A list of logs is displayed. Currently log date, level, service, and message are supported. Select a log line to view its details.

list of logs

Logging details

It is also possible to see log line details such as metadata and resource attributes.

logs details