Skip to content

Commit f664bda

Browse files
authored
Add JSON logging capability (#28)
* add JSON logging capability * colored console logging should be disabled if the tests are started from the IDE * Revert "colored console logging should be disabled if the tests are started from the IDE" This reverts commit b9fba82.
1 parent ace3496 commit f664bda

2 files changed

Lines changed: 19 additions & 6 deletions

File tree

operator/build.gradle.kts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ dependencies {
1010
implementation("io.quarkus:quarkus-config-yaml")
1111
implementation("io.quarkus:quarkus-jackson")
1212
implementation("io.quarkus:quarkus-kubernetes-client")
13+
implementation("io.quarkus:quarkus-logging-json")
1314
implementation("io.quarkus:quarkus-micrometer")
1415
implementation("io.quarkus:quarkus-micrometer-registry-prometheus")
1516
implementation("io.quarkus:quarkus-jdbc-postgresql")

operator/src/main/resources/application.yml

Lines changed: 18 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
11
quarkus:
22
console:
33
color: true
4+
log:
5+
console:
6+
json:
7+
enabled: false
8+
log-format: ECS
49
kubernetes-client:
510
devservices:
611
enabled: true
@@ -36,12 +41,6 @@ quarkus:
3641
generation-aware: true
3742
test:
3843
hang-detection-timeout: PT1M
39-
#log:
40-
# category:
41-
# "io.javaoperatorsdk":
42-
# level: DEBUG
43-
# "io.quarkiverse.operatorsdk":
44-
# level: DEBUG
4544

4645
# Config for the generated Helm chart #
4746
# Container Image config for Kubernetes Helm #
@@ -112,6 +111,15 @@ quarkus:
112111
paths:
113112
- (kind == Deployment).spec.template.spec.affinity
114113
description: Kubernetes affinity configuration for Pod scheduling
114+
console-color:
115+
property: envs.QUARKUS_CONSOLE_COLOR
116+
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.
117+
log-console-json-enabled:
118+
property: envs.QUARKUS_LOG_CONSOLE_JSON_ENABLED
119+
description: Determine whether to enable the JSON console formatting extension, which disables "normal" console formatting.
120+
log-console-json-log-format:
121+
property: envs.QUARKUS_LOG_CONSOLE_JSON_LOG_FORMAT
122+
description: Specify the format of the produced JSON. Supported values are "DEFAULT", "ECS", and "GCP".
115123
values-schema:
116124
properties:
117125
"affinity":
@@ -185,3 +193,7 @@ quarkus:
185193
env:
186194
fields:
187195
KUBERNETES_NODE_NAME: spec.nodeName
196+
vars:
197+
QUARKUS_CONSOLE_COLOR: ${quarkus.console.color}
198+
QUARKUS_LOG_CONSOLE_JSON_ENABLED: ${quarkus.log.console.json.enabled}
199+
QUARKUS_LOG_CONSOLE_JSON_LOG_FORMAT: ${quarkus.log.console.json.log-format}

0 commit comments

Comments
 (0)