|
1 | 1 | = Logging Trait |
2 | 2 |
|
3 | 3 | // Start of autogenerated code - DO NOT EDIT! (badges) |
| 4 | +[.badges] |
| 5 | +[.badge-key]##Deprecated since##[.badge-unsupported]##2.9.0## |
4 | 6 | // End of autogenerated code - DO NOT EDIT! (badges) |
| 7 | + |
| 8 | +[WARNING] |
| 9 | +==== |
| 10 | +The Logging trait is *deprecated* as of version 2.9.0 and will be removed in a future release. |
| 11 | +
|
| 12 | +Please use Quarkus logging properties directly instead. See the <<migration-guide>> section below for details. |
| 13 | +==== |
| 14 | + |
5 | 15 | // Start of autogenerated code - DO NOT EDIT! (description) |
6 | 16 | The Logging trait is used to configure Integration runtime logging options (such as color and format). |
7 | 17 | The logging backend is provided by Quarkus, whose configuration is documented at https://quarkus.io/guides/logging. |
8 | 18 |
|
| 19 | +WARNING: The Logging trait is **deprecated** and will be removed in future release versions: |
| 20 | +use Quarkus logging properties directly instead. |
| 21 | + |
| 22 | +Migration example: |
| 23 | + |
| 24 | + Before: traits.logging.level=DEBUG |
| 25 | + After: -p quarkus.log.level=DEBUG |
| 26 | + |
9 | 27 |
|
10 | 28 | This trait is available in the following profiles: **Kubernetes, Knative, OpenShift**. |
11 | 29 |
|
@@ -51,3 +69,91 @@ The following configuration options are available: |
51 | 69 | |=== |
52 | 70 |
|
53 | 71 | // End of autogenerated code - DO NOT EDIT! (configuration) |
| 72 | + |
| 73 | +[[migration-guide]] |
| 74 | +== Migration Guide |
| 75 | + |
| 76 | +The Logging trait is deprecated. You should migrate to using Quarkus properties directly, which provides the same functionality with more flexibility. |
| 77 | + |
| 78 | +=== Property Mapping |
| 79 | + |
| 80 | +The following table shows how to map Logging trait properties to Quarkus properties: |
| 81 | + |
| 82 | +[cols="2m,2m,3a"] |
| 83 | +|=== |
| 84 | +|Logging Trait | Quarkus Property | Example |
| 85 | + |
| 86 | +| logging.level=DEBUG |
| 87 | +| quarkus.log.level=DEBUG |
| 88 | +| `kamel run -p quarkus.log.level=DEBUG MyRoute.java` |
| 89 | + |
| 90 | +| logging.color=true |
| 91 | +| quarkus.console.color=true |
| 92 | +| `kamel run -p quarkus.console.color=true MyRoute.java` |
| 93 | + |
| 94 | +| logging.format=... |
| 95 | +| quarkus.log.console.format=... |
| 96 | +| `kamel run -p quarkus.log.console.format="%d{HH:mm:ss} %-5p %s%e%n" MyRoute.java` |
| 97 | + |
| 98 | +| logging.json=true |
| 99 | +| quarkus.log.console.json=true |
| 100 | +| `kamel run -p quarkus.log.console.json=true MyRoute.java` |
| 101 | + |
| 102 | +| logging.json-pretty-print=true |
| 103 | +| quarkus.log.console.json.pretty-print=true |
| 104 | +| `kamel run -p quarkus.log.console.json.pretty-print=true MyRoute.java` |
| 105 | + |
| 106 | +|=== |
| 107 | + |
| 108 | +=== Migration Examples |
| 109 | + |
| 110 | +**Before (deprecated):** |
| 111 | + |
| 112 | +[source,yaml] |
| 113 | +---- |
| 114 | +apiVersion: camel.apache.org/v1 |
| 115 | +kind: Integration |
| 116 | +metadata: |
| 117 | + name: my-integration |
| 118 | +spec: |
| 119 | + traits: |
| 120 | + logging: |
| 121 | + level: DEBUG |
| 122 | + json: true |
| 123 | + jsonPrettyPrint: true |
| 124 | +---- |
| 125 | + |
| 126 | +**After (recommended):** |
| 127 | + |
| 128 | +[source,yaml] |
| 129 | +---- |
| 130 | +apiVersion: camel.apache.org/v1 |
| 131 | +kind: Integration |
| 132 | +metadata: |
| 133 | + name: my-integration |
| 134 | +spec: |
| 135 | + configuration: |
| 136 | + - type: property |
| 137 | + value: quarkus.log.level=DEBUG |
| 138 | + - type: property |
| 139 | + value: quarkus.log.console.json=true |
| 140 | + - type: property |
| 141 | + value: quarkus.log.console.json.pretty-print=true |
| 142 | +---- |
| 143 | + |
| 144 | +Or using the CLI: |
| 145 | + |
| 146 | +[source,console] |
| 147 | +---- |
| 148 | +$ kamel run MyRoute.java \ |
| 149 | + -p quarkus.log.level=DEBUG \ |
| 150 | + -p quarkus.log.console.json=true \ |
| 151 | + -p quarkus.log.console.json.pretty-print=true |
| 152 | +---- |
| 153 | + |
| 154 | +=== Benefits of Direct Properties |
| 155 | + |
| 156 | +Using Quarkus properties directly provides more flexibility, including: |
| 157 | + |
| 158 | +* Category-specific log levels: `quarkus.log.category."org.apache.camel".level=DEBUG` |
| 159 | +* More logging options available at https://quarkus.io/guides/logging |
0 commit comments