Skip to content

Commit

Permalink
Merge pull request #1820 from lance5890/update_readme_operator_logLevel
Browse files Browse the repository at this point in the history
NO-JIRA: readme: describe mapping between operatorLogLevel and log level
  • Loading branch information
openshift-merge-bot[bot] authored Mar 3, 2025
2 parents dafd2d1 + 1d1f9e4 commit c13665b
Showing 1 changed file with 59 additions and 0 deletions.
59 changes: 59 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,65 @@ spec:
managementState: Managed
```
The log level of individual kube-apiserver instances can be increased by setting `.spec.logLevel` field:
```
$ oc explain KubeAPIServer.spec.logLevel
GROUP: operator.openshift.io
KIND: KubeAPIServer
VERSION: v1

FIELD: logLevel <string>

DESCRIPTION:
logLevel is an intent based logging for an overall component. It does not
give fine grained control, but it is a simple way to manage coarse grained
logging choices that operators have to interpret for their operands.
Valid values are: "Normal", "Debug", "Trace", "TraceAll". Defaults to
"Normal".
```
For example:
```yaml
apiVersion: operator.openshift.io/v1
kind: KubeAPIServer
metadata:
name: cluster
spec:
logLevel: Debug
...
```

Currently the log levels correspond to:

| logLevel | log level |
| -------- | --------- |
| Normal | 2 |
| Debug | 4 |
| Trace | 6 |
| TraceAll | 10 |


The log level of cluster-kube-apiserver-operator can be increased by setting `.spec.operatorLogLevel` field:
For example:
```yaml
apiVersion: operator.openshift.io/v1
kind: KubeAPIServer
metadata:
name: cluster
spec:
operatorLogLevel: Debug
...
```

Currently the operator log levels correspond to:

| operatorLogLevel | log level |
| ---------------- | --------- |
| Normal | 2 |
| Debug | 4 |
| Trace | 6 |
| TraceAll | 8 |


The current operator status is reported using the `ClusterOperator` resource. To get the current status you can run follow command:

```
Expand Down

0 comments on commit c13665b

Please sign in to comment.