7.5. Accessing build logs


You can access build logs using the web console or the CLI.

Procedure

  • To stream the logs using the build directly, enter the following command:

    $ oc describe build <build_name>

7.5.1. Accessing BuildConfig logs

You can access BuildConfig logs using the web console or the CLI.

Procedure

  • To stream the logs of the latest build for a BuildConfig, enter the following command:

    $ oc logs -f bc/<buildconfig_name>

7.5.2. Accessing BuildConfig logs for a given version build

You can access logs for a given version build for a BuildConfig using the web console or the CLI.

Procedure

  • To stream the logs for a given version build for a BuildConfig, enter the following command:

    $ oc logs --version=<number> bc/<buildconfig_name>

7.5.3. Enabling log verbosity

You can enable a more verbose output by passing the BUILD_LOGLEVEL environment variable as part of the sourceStrategy or dockerStrategy in a BuildConfig.

注意

An administrator can set the default build verbosity for the entire OpenShift Container Platform instance by configuring env/BUILD_LOGLEVEL. This default can be overridden by specifying BUILD_LOGLEVEL in a given BuildConfig. You can specify a higher priority override on the command line for non-binary builds by passing --build-loglevel to oc start-build.

Available log levels for source builds are as follows:

Level 0

Produces output from containers running the assemble script and all encountered errors. This is the default.

Level 1

Produces basic information about the executed process.

Level 2

Produces very detailed information about the executed process.

Level 3

Produces very detailed information about the executed process, and a listing of the archive contents.

Level 4

Currently produces the same information as level 3.

Level 5

Produces everything mentioned on previous levels and additionally provides docker push messages.

Procedure

  • To enable more verbose output, pass the BUILD_LOGLEVEL environment variable as part of the sourceStrategy or dockerStrategy in a BuildConfig:

    sourceStrategy:
    ...
      env:
        - name: "BUILD_LOGLEVEL"
          value: "2" 1
    1
    Adjust this value to the desired log level.
Red Hat logoGithubRedditYoutubeTwitter

学习

尝试、购买和销售

社区

关于红帽文档

通过我们的产品和服务,以及可以信赖的内容,帮助红帽用户创新并实现他们的目标。

让开源更具包容性

红帽致力于替换我们的代码、文档和 Web 属性中存在问题的语言。欲了解更多详情,请参阅红帽博客.

關於紅帽

我们提供强化的解决方案,使企业能够更轻松地跨平台和环境(从核心数据中心到网络边缘)工作。

© 2024 Red Hat, Inc.