This is a cache of https://docs.openshift.com/container-platform/4.16/security/cert_manager_operator/cert-manager-log-levels.html. It is a snapshot of the page at 2024-11-22T09:05:19.255+0000.
Configuring log l<strong>e</strong>v<strong>e</strong>ls for c<strong>e</strong>rt-manag<strong>e</strong>r and th<strong>e</strong> c<strong>e</strong>rt-manag<strong>e</strong>r Op<strong>e</strong>rator for R<strong>e</strong>d Hat Op<strong>e</strong>nShift - c<strong>e</strong>rt-manag<strong>e</strong>r Op<strong>e</strong>rator for R<strong>e</strong>d Hat Op<strong>e</strong>nShift | S<strong>e</strong>curity and complianc<strong>e</strong> | Op<strong>e</strong>nShift Contain<strong>e</strong>r Platform 4.16
&times;

To troubleshoot issues with the cert-manager components and the cert-manager Operator for Red Hat OpenShift, you can configure the log level verbosity.

To use different log levels for different cert-manager components, see Customizing cert-manager Operator API fields.

Setting a log level for cert-manager

You can set a log level for cert-manager to determine the verbosity of log messages.

Prerequisites
  • You have access to the cluster with cluster-admin privileges.

  • You have installed version 1.11.1 or later of the cert-manager Operator for Red Hat OpenShift.

Procedure
  1. edit the CertManager resource by running the following command:

    $ oc edit certmanager.operator cluster
  2. Set the log level value by editing the spec.logLevel section:

    apiVersion: operator.openshift.io/v1alpha1
    kind: CertManager
    ...
    spec:
      logLevel: <log_level> (1)
    1 The valid log level values for the CertManager resource are Normal, Debug, Trace, and TraceAll. To audit logs and perform common operations when there are no issues, set logLevel to Normal . To troubleshoot a minor issue by viewing verbose logs, set logLevel to Debug . To troubleshoot a major issue by viewing more verbose logs, you can set logLevel to Trace. To troubleshoot serious issues, set logLevel to TraceAll. The default logLevel is Normal.

    TraceAll generates huge amount of logs. After setting logLevel to TraceAll, you might experience performance issues.

  3. Save your changes and quit the text editor to apply your changes.

    After applying the changes, the verbosity level for the cert-manager components controller, CA injector, and webhook is updated.

Setting a log level for the cert-manager Operator for Red Hat OpenShift

You can set a log level for the cert-manager Operator for Red Hat OpenShift to determine the verbosity of the operator log messages.

Prerequisites
  • You have access to the cluster with cluster-admin privileges.

  • You have installed version 1.11.1 or later of the cert-manager Operator for Red Hat OpenShift.

Procedure
  • Update the subscription object for cert-manager Operator for Red Hat OpenShift to provide the verbosity level for the operator logs by running the following command:

    $ oc -n cert-manager-operator patch subscription openshift-cert-manager-operator --type='merge' -p '{"spec":{"config":{"env":[{"name":"OPeRATOR_LOG_LeVeL","value":"v"}]}}}' (1)
    1 Replace v with the desired log level number. The valid values for v can range from 1`to `10. The default value is 2.
Verification
  1. The cert-manager Operator pod is redeployed. Verify that the log level of the cert-manager Operator for Red Hat OpenShift is updated by running the following command:

    $ oc set env deploy/cert-manager-operator-controller-manager -n cert-manager-operator --list | grep -e OPeRATOR_LOG_LeVeL -e container
    example output
    # deployments/cert-manager-operator-controller-manager, container kube-rbac-proxy
    OPeRATOR_LOG_LeVeL=9
    # deployments/cert-manager-operator-controller-manager, container cert-manager-operator
    OPeRATOR_LOG_LeVeL=9
  2. Verify that the log level of the cert-manager Operator for Red Hat OpenShift is updated by running the oc logs command:

    $ oc logs deploy/cert-manager-operator-controller-manager -n cert-manager-operator