You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by pc...@apache.org on 2022/05/10 12:50:35 UTC

[camel-k] branch main updated (cf1e93277 -> 442c15861)

This is an automated email from the ASF dual-hosted git repository.

pcongiusti pushed a change to branch main
in repository https://gitbox.apache.org/repos/asf/camel-k.git


    from cf1e93277 Updated CHANGELOG.md
     new e3021f6f1 added logging traits documentation
     new 9c9b71290 renamed files, removed image, added a log output to readme
     new 3fe4c27ac fixed typo error
     new 442c15861 corrected typo error

The 4 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 .../RestDSL.java => traits/logging/Logging.java}   |  8 ++--
 .../logging/LoggingModeline.java}                  |  9 ++--
 examples/traits/logging/README.md                  | 51 ++++++++++++++++++++++
 3 files changed, 57 insertions(+), 11 deletions(-)
 copy examples/{rest/RestDSL.java => traits/logging/Logging.java} (86%)
 copy examples/{rest/RestDSL.java => traits/logging/LoggingModeline.java} (87%)
 create mode 100644 examples/traits/logging/README.md


[camel-k] 04/04: corrected typo error

Posted by pc...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

pcongiusti pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/camel-k.git

commit 442c15861ea006f5c988f69c04451592782eded1
Author: gre8t <ak...@gmail.com>
AuthorDate: Tue May 10 05:58:05 2022 +0100

    corrected typo error
---
 examples/traits/logging/README.md | 13 +++++++------
 1 file changed, 7 insertions(+), 6 deletions(-)

diff --git a/examples/traits/logging/README.md b/examples/traits/logging/README.md
index 9f0eb8e41..4b1fa062d 100644
--- a/examples/traits/logging/README.md
+++ b/examples/traits/logging/README.md
@@ -4,15 +4,15 @@ This type of trait tells us what is going on in a running integration pod. It do
 
 Logs are enabled by default on an integration. Just run this example:
 
-     $ kamel run logging.java
+     $ kamel run Logging.java
 
-     $ kamel logs logging
+     $ kamel logs Logging
 
 Or you can instead get the pod name and print its logs using kubectl: 
 
      $ kubectl get pods
 
-     $ kubecttl logs <pod name>
+     $ kubectl logs <pod name>
 
 You can configure the log output with the `logging traits` flag:
       
@@ -28,11 +28,12 @@ for more traits options see this [Link.](https://camel.apache.org/camel-k/next/t
 
 manual log setting example using  `logging trait`:
      
-     $ kamel run ./logging.java --trait logging.enabled=true --trait logging.json=true --trait logging.level=info
+     $ kamel run ./Logging.java --trait logging.enabled=true --trait logging.json=true \
+     --trait logging.level=info
 
 **Output**
 
-The output of this result would give this:
+The output of this result would be:
 
 ```
 [2] {"timestamp":"2022-04-24T22:50:06.303Z","sequence":183,"loggerClassName":"org.slf4j.impl.Slf4jLogger","loggerName":"org.apache.camel.impl.engine.AbstractCamelContext","level":"INFO","message":"Apache Camel 3.14.1 (camel-1) started in 352ms (build:0ms init:293ms start:59ms)","threadName":"main","threadId":1,"mdc":{},"ndc":"","hostName":"rest-dsl-56668cc6dc-9zz7r","processName":"io.quarkus.bootstrap.runner.QuarkusEntryPoint","processId":1}
@@ -46,5 +47,5 @@ The output of this result would give this:
 ## Using modeline 
 An example of using a `modeline` to set the `logging traits` : 
 
-     $ kamel run ./loggingModeline.java 
+     $ kamel run ./LoggingModeline.java 
 


[camel-k] 02/04: renamed files, removed image, added a log output to readme

Posted by pc...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

pcongiusti pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/camel-k.git

commit 9c9b712909842401cd503212f249711a95384e19
Author: gre8t <ak...@gmail.com>
AuthorDate: Mon Apr 25 12:25:19 2022 +0100

    renamed files, removed image, added a log output to readme
---
 examples/traits/logging/{logging.java => Logging.java} |   2 +-
 .../{loggingModeline.java => LoggingModeline.java}     |   2 +-
 examples/traits/logging/README.md                      |  15 ++++++++++-----
 examples/traits/logging/interface/json.png             | Bin 222043 -> 0 bytes
 4 files changed, 12 insertions(+), 7 deletions(-)

diff --git a/examples/traits/logging/logging.java b/examples/traits/logging/Logging.java
similarity index 95%
rename from examples/traits/logging/logging.java
rename to examples/traits/logging/Logging.java
index 5a3583322..151a537f4 100644
--- a/examples/traits/logging/logging.java
+++ b/examples/traits/logging/Logging.java
@@ -20,7 +20,7 @@
 //  --trait logging.json=true --trait logging.level=info
 import org.apache.camel.Exchange;
 
-public class RestDSL extends org.apache.camel.builder.RouteBuilder {
+public class Logging extends org.apache.camel.builder.RouteBuilder {
     @Override
     public void configure() throws Exception {
         rest()
diff --git a/examples/traits/logging/loggingModeline.java b/examples/traits/logging/LoggingModeline.java
similarity index 94%
rename from examples/traits/logging/loggingModeline.java
rename to examples/traits/logging/LoggingModeline.java
index 000917a94..4f56276ec 100644
--- a/examples/traits/logging/loggingModeline.java
+++ b/examples/traits/logging/LoggingModeline.java
@@ -19,7 +19,7 @@
 
 import org.apache.camel.Exchange;
 
-public class RestDSL extends org.apache.camel.builder.RouteBuilder {
+public class LoggingModeline extends org.apache.camel.builder.RouteBuilder {
     @Override
     public void configure() throws Exception {
         rest()
diff --git a/examples/traits/logging/README.md b/examples/traits/logging/README.md
index d8477ee03..3c8e589b4 100644
--- a/examples/traits/logging/README.md
+++ b/examples/traits/logging/README.md
@@ -30,14 +30,19 @@ manual log setting example using  `logging trait`:
      
      $kamel run ./logging.java --trait logging.enabled=true --trait logging.json=true --trait logging.level=info
 
-The output of this result would give this:
-- Logging would be enabled, but there would be no colors for easy skimming.
-- You would need to use your own jq to pretty print and parse the json output. 
+**Output**
 
-**Image example**
-![json](interface/json.png)
+The output of this result would give this:
 
+```
+[2] {"timestamp":"2022-04-24T22:50:06.303Z","sequence":183,"loggerClassName":"org.slf4j.impl.Slf4jLogger","loggerName":"org.apache.camel.impl.engine.AbstractCamelContext","level":"INFO","message":"Apache Camel 3.14.1 (camel-1) started in 352ms (build:0ms init:293ms start:59ms)","threadName":"main","threadId":1,"mdc":{},"ndc":"","hostName":"rest-dsl-56668cc6dc-9zz7r","processName":"io.quarkus.bootstrap.runner.QuarkusEntryPoint","processId":1}
+[2] {"timestamp":"2022-04-24T22:50:06.835Z","sequence":184,"loggerClassName":"org.jboss.logging.Logger","loggerName":"io.quarkus","level":"INFO","message":"camel-k-integration 1.8.2 on JVM (powered by Quarkus 2.7.0.Final) started in 14.348s. Listening on: http://0.0.0.0:8080","threadName":"main","threadId":1,"mdc":{},"ndc":"","hostName":"rest-dsl-56668cc6dc-9zz7r","processName":"io.quarkus.bootstrap.runner.QuarkusEntryPoint","processId":1}
+[2] {"timestamp":"2022-04-24T22:50:06.842Z","sequence":185,"loggerClassName":"org.jboss.logging.Logger","loggerName":"io.quarkus","level":"INFO","message":"Profile prod activated. ","threadName":"main","threadId":1,"mdc":{},"ndc":"","hostName":"rest-dsl-56668cc6dc-9zz7r","processName":"io.quarkus.bootstrap.runner.QuarkusEntryPoint","processId":1}
+[2] {"timestamp":"2022-04-24T22:50:06.842Z","sequence":186,"loggerClassName":"org.jboss.logging.Logger","loggerName":"io.quarkus","level":"INFO","message":"Installed features: [camel-attachments, camel-bean, camel-core, camel-direct, camel-java-joor-dsl, camel-k-core, camel-k-runtime, camel-platform-http, camel-rest, cdi, smallrye-context-propagation, vertx]","threadName":"main","threadId":1,"mdc":{},"ndc":"","hostName":"rest-dsl-56668cc6dc-9zz7r","processName":"io.quarkus.bootstrap.runn [...]
 
+```
+- Logging would be enabled, and it's output would be in josn. But, there would be no colors for easy skimming.
+- You would need to use your own jq to pretty print and parse the json output. 
 ## using modeline 
 An example of using a `modeline` to set the `logging traits` : 
 
diff --git a/examples/traits/logging/interface/json.png b/examples/traits/logging/interface/json.png
deleted file mode 100644
index 48631f103..000000000
Binary files a/examples/traits/logging/interface/json.png and /dev/null differ


[camel-k] 01/04: added logging traits documentation

Posted by pc...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

pcongiusti pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/camel-k.git

commit e3021f6f1d1cba849db97b6f71276dd1da54640e
Author: gre8t <ak...@gmail.com>
AuthorDate: Mon Apr 25 00:04:31 2022 +0100

    added logging traits documentation
---
 examples/traits/logging/README.md            |  45 +++++++++++++++++++++++++++
 examples/traits/logging/interface/json.png   | Bin 0 -> 222043 bytes
 examples/traits/logging/logging.java         |  34 ++++++++++++++++++++
 examples/traits/logging/loggingModeline.java |  33 ++++++++++++++++++++
 4 files changed, 112 insertions(+)

diff --git a/examples/traits/logging/README.md b/examples/traits/logging/README.md
new file mode 100644
index 000000000..d8477ee03
--- /dev/null
+++ b/examples/traits/logging/README.md
@@ -0,0 +1,45 @@
+# Logging Trait
+
+This type of trait tells us what is going on in a running integration pod. It does this by printing logs out to the standard output.
+
+Logs are enabled by default on an integration. Just run this example:
+
+     $kamel run logging.java
+
+     $kamel logs logging
+
+Or you can instead get the pod name and print its logs using kubectl: 
+
+     $kubectl get pods
+
+     $kubecttl logs <pod name>
+
+You can configure the log output with the `logging traits` flag:
+      
+Property | Type | Description 
+---|---|---  
+logging.enabled | boolean| We can set to false to disable logging
+logging.color | boolean| makes logging output colorful. This makes skimming through the logs easier.
+logging.json | boolean | Makes logs output to be in json format. We can use tools like `jq` to manipulate output.
+logging.json-pretty-print | boolean | It's like using an in built `jq` to print our json output.
+logging.level | string | This is just a verbosity level settings. We can just use `info`
+
+for more traits options see this [Link.](https://camel.apache.org/camel-k/next/traits/logging.html).
+
+manual log setting example using  `logging trait`:
+     
+     $kamel run ./logging.java --trait logging.enabled=true --trait logging.json=true --trait logging.level=info
+
+The output of this result would give this:
+- Logging would be enabled, but there would be no colors for easy skimming.
+- You would need to use your own jq to pretty print and parse the json output. 
+
+**Image example**
+![json](interface/json.png)
+
+
+## using modeline 
+An example of using a `modeline` to set the `logging traits` : 
+
+     $kamel run ./loggingModeline.java 
+
diff --git a/examples/traits/logging/interface/json.png b/examples/traits/logging/interface/json.png
new file mode 100644
index 000000000..48631f103
Binary files /dev/null and b/examples/traits/logging/interface/json.png differ
diff --git a/examples/traits/logging/logging.java b/examples/traits/logging/logging.java
new file mode 100644
index 000000000..5a3583322
--- /dev/null
+++ b/examples/traits/logging/logging.java
@@ -0,0 +1,34 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+//
+//  kamel run ./logging.java --trait logging.enabled=true \
+//  --trait logging.json=true --trait logging.level=info
+import org.apache.camel.Exchange;
+
+public class RestDSL extends org.apache.camel.builder.RouteBuilder {
+    @Override
+    public void configure() throws Exception {
+        rest()
+            .get("/hello")
+            .to("direct:hello");
+
+        from("direct:hello")
+            .setHeader(Exchange.CONTENT_TYPE, constant("text/plain"))
+            .transform().simple("Hello World");
+    }
+}
diff --git a/examples/traits/logging/loggingModeline.java b/examples/traits/logging/loggingModeline.java
new file mode 100644
index 000000000..000917a94
--- /dev/null
+++ b/examples/traits/logging/loggingModeline.java
@@ -0,0 +1,33 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+// camel-k: traits=logging.enabled=true trait=logging.json=true trait=logging.level=info
+
+import org.apache.camel.Exchange;
+
+public class RestDSL extends org.apache.camel.builder.RouteBuilder {
+    @Override
+    public void configure() throws Exception {
+        rest()
+            .get("/hello")
+            .to("direct:hello");
+
+        from("direct:hello")
+            .setHeader(Exchange.CONTENT_TYPE, constant("text/plain"))
+            .transform().simple("Hello World");
+    }
+}


[camel-k] 03/04: fixed typo error

Posted by pc...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

pcongiusti pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/camel-k.git

commit 3fe4c27ac65439bbb43c437242ac74512ff4c68e
Author: gre8t <ak...@gmail.com>
AuthorDate: Tue Apr 26 16:24:46 2022 +0100

    fixed typo error
---
 examples/traits/logging/Logging.java |  2 +-
 examples/traits/logging/README.md    | 14 +++++++-------
 2 files changed, 8 insertions(+), 8 deletions(-)

diff --git a/examples/traits/logging/Logging.java b/examples/traits/logging/Logging.java
index 151a537f4..e3d24e1d6 100644
--- a/examples/traits/logging/Logging.java
+++ b/examples/traits/logging/Logging.java
@@ -16,7 +16,7 @@
  */
 
 //
-//  kamel run ./logging.java --trait logging.enabled=true \
+//  kamel run ./Logging.java --trait logging.enabled=true \
 //  --trait logging.json=true --trait logging.level=info
 import org.apache.camel.Exchange;
 
diff --git a/examples/traits/logging/README.md b/examples/traits/logging/README.md
index 3c8e589b4..9f0eb8e41 100644
--- a/examples/traits/logging/README.md
+++ b/examples/traits/logging/README.md
@@ -4,15 +4,15 @@ This type of trait tells us what is going on in a running integration pod. It do
 
 Logs are enabled by default on an integration. Just run this example:
 
-     $kamel run logging.java
+     $ kamel run logging.java
 
-     $kamel logs logging
+     $ kamel logs logging
 
 Or you can instead get the pod name and print its logs using kubectl: 
 
-     $kubectl get pods
+     $ kubectl get pods
 
-     $kubecttl logs <pod name>
+     $ kubecttl logs <pod name>
 
 You can configure the log output with the `logging traits` flag:
       
@@ -28,7 +28,7 @@ for more traits options see this [Link.](https://camel.apache.org/camel-k/next/t
 
 manual log setting example using  `logging trait`:
      
-     $kamel run ./logging.java --trait logging.enabled=true --trait logging.json=true --trait logging.level=info
+     $ kamel run ./logging.java --trait logging.enabled=true --trait logging.json=true --trait logging.level=info
 
 **Output**
 
@@ -43,8 +43,8 @@ The output of this result would give this:
 ```
 - Logging would be enabled, and it's output would be in josn. But, there would be no colors for easy skimming.
 - You would need to use your own jq to pretty print and parse the json output. 
-## using modeline 
+## Using modeline 
 An example of using a `modeline` to set the `logging traits` : 
 
-     $kamel run ./loggingModeline.java 
+     $ kamel run ./loggingModeline.java