7.2. Configuring Pipelines as Code logging


You can configure Pipelines as Code logging by editing the pac-config-logging config map in the TektonConfig custom resource (CR).

Prerequisites

  • You have Pipelines as Code installed on your cluster.

Procedure

  1. In the Administrator perspective of the web console, go to Administration CustomResourceDefinitions.
  2. Use the Search by name field to search for the tektonconfigs.operator.tekton.dev custom resource definition (CRD) and click TektonConfig to view the CRD Details page.
  3. Click the Instances tab.
  4. Click the config instance to view the TektonConfig CR details.
  5. Click the YAML tab.
  6. Edit the loglevel. fields under the .options.configMaps.pac-config-logging.data parameter based on your requirements.

    Example TektonConfig CR with the Pipelines as Code log level fields set to warn

    apiVersion: operator.tekton.dev/v1alpha1
    kind: TektonConfig
    metadata:
      name: config
    spec:
      platforms:
        openshift:
          pipelinesAsCode:
            options:
              configMaps:
                pac-config-logging:
                  data:
                    loglevel.pac-watcher: warn 
    1
    
                    loglevel.pipelines-as-code-webhook: warn 
    2
    
                    loglevel.pipelinesascode: warn 
    3
    
                    zap-logger-config: |
                      {
                        "level": "info",
                        "development": false,
                        "sampling": {
                          "initial": 100,
                          "thereafter": 100
                        },
                        "outputPaths": ["stdout"],
                        "errorOutputPaths": ["stderr"],
                        "encoding": "json",
                        "encoderConfig": {
                          "timeKey": "ts",
                          "levelKey": "level",
                          "nameKey": "logger",
                          "callerKey": "caller",
                          "messageKey": "msg",
                          "stacktraceKey": "stacktrace",
                          "lineEnding": "",
                          "levelEncoder": "",
                          "timeEncoder": "iso8601",
                          "durationEncoder": "",
                          "callerEncoder": ""
                        }
                      }

    1
    The log level for the pipelines-as-code-watcher component.
    2
    The log level for the pipelines-as-code-webhook component.
    3
    The log level for the pipelines-as-code-controller component.
  7. Optional: Create a custom logging config map for the Pipelines as Code components by changing the .env.value for each component under the .options.deployments field. The example below shows the configuration with the custom config map called custom-pac-config-logging.

    Example TektonConfig CR with the Pipelines as Code custom logging config map

    apiVersion: operator.tekton.dev/v1alpha1
    kind: TektonConfig
    metadata:
      name: config
    spec:
      platforms:
        openshift:
          pipelinesAsCode:
            enable: true
            options:
              configMaps:
                custom-pac-config-logging:
                  data:
                    loglevel.pac-watcher: warn
                    loglevel.pipelines-as-code-webhook: warn
                    loglevel.pipelinesascode: warn
                    zap-logger-config: |
                      {
                        "level": "info",
                        "development": false,
                        "sampling": {
                          "initial": 100,
                          "thereafter": 100
                        },
                        "outputPaths": ["stdout"],
                        "errorOutputPaths": ["stderr"],
                        "encoding": "json",
                        "encoderConfig": {
                          "timeKey": "ts",
                          "levelKey": "level",
                          "nameKey": "logger",
                          "callerKey": "caller",
                          "messageKey": "msg",
                          "stacktraceKey": "stacktrace",
                          "lineEnding": "",
                          "levelEncoder": "",
                          "timeEncoder": "iso8601",
                          "durationEncoder": "",
                          "callerEncoder": ""
                        }
                      }
              deployments:
                pipelines-as-code-controller:
                  spec:
                    template:
                      spec:
                        containers:
                        - name: pac-controller
                          env:
                          - name: CONFIG_LOGGING_NAME
                            value: custom-pac-config-logging
                pipelines-as-code-watcher:
                  spec:
                    template:
                      spec:
                        containers:
                        - name: pac-watcher
                          env:
                          - name: CONFIG_LOGGING_NAME
                            value: custom-pac-config-logging
                pipelines-as-code-webhook:
                  spec:
                    template:
                      spec:
                        containers:
                        - name: pac-webhook
                          env:
                          - name: CONFIG_LOGGING_NAME
                            value: custom-pac-config-logging

Red Hat logoGithubredditYoutubeTwitter

詳細情報

試用、購入および販売

コミュニティー

会社概要

Red Hat は、企業がコアとなるデータセンターからネットワークエッジに至るまで、各種プラットフォームや環境全体で作業を簡素化できるように、強化されたソリューションを提供しています。

多様性を受け入れるオープンソースの強化

Red Hat では、コード、ドキュメント、Web プロパティーにおける配慮に欠ける用語の置き換えに取り組んでいます。このような変更は、段階的に実施される予定です。詳細情報: Red Hat ブログ.

Red Hat ドキュメントについて

Legal Notice

Theme

© 2026 Red Hat
トップに戻る