From fad749be17903d830238899526a96cd379aeee1f Mon Sep 17 00:00:00 2001 From: Thomas Sapelza Date: Tue, 3 Feb 2026 13:45:06 +0100 Subject: [PATCH 1/3] add JSON logging capability --- operator/build.gradle.kts | 1 + operator/src/main/resources/application.yml | 24 +++++++++++++++------ 2 files changed, 19 insertions(+), 6 deletions(-) diff --git a/operator/build.gradle.kts b/operator/build.gradle.kts index 4ea92ba..ed59312 100644 --- a/operator/build.gradle.kts +++ b/operator/build.gradle.kts @@ -10,6 +10,7 @@ dependencies { implementation("io.quarkus:quarkus-config-yaml") implementation("io.quarkus:quarkus-jackson") implementation("io.quarkus:quarkus-kubernetes-client") + implementation("io.quarkus:quarkus-logging-json") implementation("io.quarkus:quarkus-micrometer") implementation("io.quarkus:quarkus-micrometer-registry-prometheus") implementation("io.quarkus:quarkus-jdbc-postgresql") diff --git a/operator/src/main/resources/application.yml b/operator/src/main/resources/application.yml index a26942c..4405940 100644 --- a/operator/src/main/resources/application.yml +++ b/operator/src/main/resources/application.yml @@ -1,6 +1,11 @@ quarkus: console: color: true + log: + console: + json: + enabled: false + log-format: ECS kubernetes-client: devservices: enabled: true @@ -36,12 +41,6 @@ quarkus: generation-aware: true test: hang-detection-timeout: PT1M - #log: - # category: - # "io.javaoperatorsdk": - # level: DEBUG - # "io.quarkiverse.operatorsdk": - # level: DEBUG # Config for the generated Helm chart # # Container Image config for Kubernetes Helm # @@ -112,6 +111,15 @@ quarkus: paths: - (kind == Deployment).spec.template.spec.affinity description: Kubernetes affinity configuration for Pod scheduling + console-color: + property: envs.QUARKUS_CONSOLE_COLOR + description: If color should be enabled or disabled. If this is unset, then an attempt will be made to guess if the terminal supports color. + log-console-json-enabled: + property: envs.QUARKUS_LOG_CONSOLE_JSON_ENABLED + description: Determine whether to enable the JSON console formatting extension, which disables "normal" console formatting. + log-console-json-log-format: + property: envs.QUARKUS_LOG_CONSOLE_JSON_LOG_FORMAT + description: Specify the format of the produced JSON. Supported values are "DEFAULT", "ECS", and "GCP". values-schema: properties: "affinity": @@ -185,3 +193,7 @@ quarkus: env: fields: KUBERNETES_NODE_NAME: spec.nodeName + vars: + QUARKUS_CONSOLE_COLOR: ${quarkus.console.color} + QUARKUS_LOG_CONSOLE_JSON_ENABLED: ${quarkus.log.console.json.enabled} + QUARKUS_LOG_CONSOLE_JSON_LOG_FORMAT: ${quarkus.log.console.json.log-format} From b9fba82415c508857411b5b73766c5368b8d42ca Mon Sep 17 00:00:00 2001 From: Thomas Sapelza Date: Tue, 3 Feb 2026 14:03:24 +0100 Subject: [PATCH 2/3] colored console logging should be disabled if the tests are started from the IDE --- operator/src/main/resources/application-test.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/operator/src/main/resources/application-test.yml b/operator/src/main/resources/application-test.yml index d37b73f..7e1f6d1 100644 --- a/operator/src/main/resources/application-test.yml +++ b/operator/src/main/resources/application-test.yml @@ -1,4 +1,6 @@ quarkus: + console: + color: false operator-sdk: activate-leader-election-for-profiles: - test From 10cb1a26c726d193a71b3f2f32d5674eaae78a43 Mon Sep 17 00:00:00 2001 From: Thomas Sapelza Date: Tue, 3 Feb 2026 14:18:54 +0100 Subject: [PATCH 3/3] Revert "colored console logging should be disabled if the tests are started from the IDE" This reverts commit b9fba82415c508857411b5b73766c5368b8d42ca. --- operator/src/main/resources/application-test.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/operator/src/main/resources/application-test.yml b/operator/src/main/resources/application-test.yml index 7e1f6d1..d37b73f 100644 --- a/operator/src/main/resources/application-test.yml +++ b/operator/src/main/resources/application-test.yml @@ -1,6 +1,4 @@ quarkus: - console: - color: false operator-sdk: activate-leader-election-for-profiles: - test